Re: getting renice to work from .xinitrc

From: Jin Guojun[VFF] <jguojun_at_gmail.com>
Date: Wed, 06 Aug 2025 19:14:01 UTC
On 8/6/25 12:05, Gary Aitken wrote:
> I'm trying to get certain xterms reniced when X starts up,
> but they don't seem to be working.
>
> relevant lines in xinitrc:
>
> /usr/local/bin/startxfce4 --with-ck-launch &
>
> /usr/local/bin/xterm -sb -sl 2000 -geometry =132x24+10+50 -bg 
> rgb:fa/ea/fa -name trm-1 &
> /usr/local/bin/xterm -sb -sl 2000 -geometry =132x24+360+400 -bg 
> powderblue -name root-1 &
>
> bash -c " sleep 30 && sudo renice -n -10 `ps -ao pid,args | grep 
> root-1 | grep -v grep | awk '{ print $1 }'` "
>
> If I execute this from an xterm *after* X is up and stabilized, it 
> works fine:
>
> ~$ bash -c " sleep 30 && sudo renice -n -10 `ps -ao pid,args | grep 
> trm-1 | grep -v grep | awk '{ print $1 }'` "
> 1316: old priority 0, new priority -10
> ~$ ps -o pid,pri,nice,args | egrep "PID|trm-1" | grep -v egrep
>  PID PRI  NI COMMAND
> 1316  20 -10 /usr/local/bin/xterm -sb -sl 2000 -geometry =132x24+10+50 
> -bg rgb:fa/ea/fa -name trm-1
>
> The "sleep 30" is supposed to delay the renice until the wm has 
> settled down and
> the xterms are up.
>
> What am I missing?
>
> Thanks,
>
> Gary
>
Two issues I can see:

(1) bash may need a path in front since it is not in default system PATH.

(2) .xinitrc has "grep root-1", where command line has "grep trm-1"; 
which is typo???

-Jin