I would like to know how to make a program (Eclipse) always start with a lower 'nice' value.
I tried to manipulate ‘/usr/share/applications/eclipse.desktop’ - with no success.
Exec='nice -n -10 eclipse'
Here is the solution as described by 'geirha':
Step 1 - allow user to run nice on eclipse as root:
EDITOR=nano visudo -f /etc/sudoers.d/local_changes
# Last row must always be empty! # Allow certain users to change 'nice' values User_Alias NICE_USERS = USER_NAME1, USER_NAME2... Cmnd_Alias SET_ECLIPSE_NICE = /root/eclips_nice.sh NICE_USERS ALL = NOPASSWD:SET_ECLIPSE_NICE
Step 2 - create the script that launches eclipse with nice -10:
#!/bin/bash nice -n -10 sudo -H -u "$1" eclipse exit
chmod u+x /root/eclips_nice.sh
Step 3 - edit eclipse launcher:
change Exec to:
Exec=sh -c 'gksudo -- /root/eclips_nice.sh "$USER"'