Re: Start something from sawfishrc

On Mon, Nov 10, 2003 at 02:10:58PM -0800, geoff cs hmc edu wrote:
> The way I do it (in my .xinitrc) is:

I am now by my own machine so I can quote "real things".
I have a script in /usr/local/bin/maybe_restart which looks
as follows:

#! /bin/sh

who="$(id -u)"
iown () {
    [ "$who" = $3 ]
for p in $(/sbin/pidof $1) ; do
    iown $(\ls -ldn /proc/$p) && exit
exec $@

and for example that in ~/.sawfishrc:
(system "maybe-restart rclock -geometry 74x74+60+15 -bg lightgray &")

That way if an application which I want to stick there, like this
rclock, will get terminated for whatever reasons then restarting
sawfish will bring it back but is not getting started again if
already there.  This, obviously, will not work for applications
started via various shell wrappers, like mozilla.  You need a name
of a "real process" as the first argument to 'maybe_restart'.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]