[dev] [dwm] terminating the status loop

From: Thomas Dahms <dahms_AT_ymail.com>
Date: Wed, 27 Apr 2011 13:20:13 +0200

Hi list,

using something like

   while true; do
       xsetroot -name ...
       sleep 1
   done &
   exec dwm

in .xsession (I have to use KDM at work) as advertised in dwm's README
leaves the background loop running even after logout, which has some ugly
side effects: While not logged in, xsetroot floods the logs because it is
unable to find the display. And logging back in, I have two loops running.

The following fixes the problem:

   while true; do
       xsetroot -name ...
       sleep 1
   done & statuspid=$!
   dwm &
   wait $!
   kill $statuspid

This looks quite ugly and I am curious if there is a more elegant way to
terminate the status loop on logout.

Thomas Dahms
Received on Wed Apr 27 2011 - 13:20:13 CEST

This archive was generated by hypermail 2.2.0 : Wed Apr 27 2011 - 13:24:02 CEST