Re: [dwm] quitting dwm-in-pipe

From: mikshaw <mrblog_AT_yahoo.com>
Date: Wed, 18 Oct 2006 17:40:53 -0400

That looks very cool...i'm gonna have to try it.
Thanks =o)

>From Jukka Salmi, (18/10/06 23:25):
> I'm using a script writing status bar information to a fifo from
> which dwm reads. This seems to work well for both startx and xdm X
> initialisation and doesn't suffer from the problems you describe.
>
> The script (~/.dwm/in.sh) basically contains:
>
> #!/bin/sh -e
>
> [ $# -eq 1 ]; FIFO="$1"
> [ -e "$FIFO" ] || mkfifo "$FIFO"
> [ -p "$FIFO" ]
> exec >"$FIFO" 2>&1
>
> while :; do
> # XXX write dwm status bar information
> sleep 10
> done
> exit 1 # NOTREACHED
>
> It creates the fifo if it doesn't exist, redirects stdout and stderr
> to it and loops forever, writing status bar information.
>
> My ~/.xinitrc (or ~/.xsession, if using xdm) contains:
>
> WM=dwm
> fifo=~/.dwm/in
>
> ~/.dwm/in.sh $fifo &
> while [ ! -p $fifo ]; do sleep .1; done
> exec <$fifo
>
> $WM &
> wmpid=$!
> wait $wmpid
>
> This starts the status bar information writing script in the background
> and waits until the fifo is created. It then redirects stdin from the
> fifo (for dwm), starts dwm and waits for it. Thus exiting (or killing)
> dwm causes X to shut down.
>
>
> HTH, Jukka
>
> --
> bashian roulette:
> $ ((RANDOM%6)) || rm -rf ~
>
>
Received on Wed Oct 18 2006 - 23:36:06 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:32:07 UTC