Re: getting renice to work from .xinitrc

From: Gary Aitken <freebsd_at_dreamchaser.org>
Date: Wed, 06 Aug 2025 23:02:08 UTC
On 8/6/25 11:56, Richard M Kreuter wrote:
> Gary Aitken writes:
>> I'm trying to get certain xterms reniced when X starts up,
>> but they don't seem to be working...
> 
> By default, ps truncates the command's args list to a width given by
> $COLUMNS or the tty driver.

Ah, forgot about that, thanks.
My xterms are 132 and 80 will cut off the arg I'm grepping for.

> Could you try invoking ps as 'ps -awwo pid,args' at the relevant spot in
> your .xinitrc? (That's two double-yews there. One would suffice for the
> commands you showed, but two would be best in general. See 'man ps'.)

Thanks.  That mostly worked.
Did not work for Xorg process or xfwm process,
even though those strings show up in the px -awwo output.
Changing the selection to -awwo pid,comm,args picked them up.
I don't understand that...

> PS: I don't think you need bash for the pipelines you showed, or to
> invoke the piplines using -c, or the second grep, or even the first
> grep. For the commands you showed, I believe this line ought to do:
> 
> sleep 30 && sudo renice -n -10 `ps -awwo pid,args | awk '/trm-1$/{print $1}'`

Thanks.  Most of that cruft (bash -c) was added trying to get it to work.
I thought the second grep was needed to get rid of the grep invoking command,
but that's only when run from a terminal, not startx/.xinitrc.
Thanks.

> But this is orthogonal to the question you asked, so please ignore this
> postscript if there are reasons for the original pipeline and 'bash -c'.

Appreciate the extra info.

Gary