@Paradiesstaub ah right, only root can set a niceness lower than 0, so you have to renice it afterwards, as root.
–
geirhaFeb 25 '12 at 12:51

Okay, your solution works for admin users. Now lets remove the pw dialog. I tried all the time to exit '/etc/sudoers.d/' → 'Cmnd_Alias SET_NICE = /usr/bin/nice -n -10 sudo -u tux eclipse'. This works too but only for one user. So maybe you can tell me a way how to remove the pw dialog or I find a generic way using sudoers.d
–
ParadiesstaubFeb 25 '12 at 13:16

@Paradiesstaub For that, write a wrapper script that does nice -n -10 sudo -H -u "$USER" eclipse, change the desktop entry to Exec=gksudo -- thatscript, and allow the users to run this script as root instead.
–
geirhaFeb 25 '12 at 13:35

1

@Paradiesstaub err, I didn't think that through. The USER variable in that script will be root, so Exec=sh -c 'gksudo -- thatscript "$USER"' and use "$1" instead of "$USER" in the script.
–
geirhaFeb 25 '12 at 13:42