How to set default nice level for an application

Nils Kassube kassube at
Wed Nov 24 17:51:23 UTC 2010

Matthias Andersson wrote:
> On 11/24/2010 08:09 AM, Nils Kassube wrote:
> > But if you mean
> > 19, I would suggest you create a starter for thunderbird on your
> > desktop which starts the command
> > 
> > /usr/bin/nice -19 /usr/bin/thunderbird
> > 
> > and maybe you should also consider using ionice (see "man ionice")
> > which would make the command:
> > 
> > /usr/bin/nice -19 /usr/bin/ionice -c3 /usr/bin/thunderbird
> Sorry, I meant level 19. I have run the command renice -n 19 -p <pid>
> to set thunderbird to run at a higher nice level. However, is there
> some way of doing this automagically?

Yes, it could be done with a script like this (untested):

while true;do
  pids=$(/bin/pidof thunderbird)
  test -z "$pids" || /usr/bin/renice -19 $pids
  sleep 1m

Make that script executable and make it run at startup. Sorry, I can't 
tell you how to do it with Gnome but with KDE you could put the script 
in $HOME/.kde/Autostart/. However I would prefer to use a starter like I 
wrote in my previous reply. That avoids renicing processes every minute 
which are already at level 19 and thunderbird is run with level 19 from 
the start.


More information about the ubuntu-users mailing list