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

Re: Here's a diff to my .xsession (was Re: Here's my .xsession)



jim@laney.edu writes:

> Hi,

> already found a problem: comment lines in /etc/X11/window-managers that
> match the chosen favorite window manager cause the script to fail weirdly...
> Problem reported by jodi@owns.stanford.edu

> this patch filters comment lines first. (Note to Branden: you might want
> to use this logic, or something like it, in the global Xsession.)

Seems to me like it might be easier if the existing global Xsession
simply had an option to check through ~/.window-managers if one exists,
and only check /etc/X11/window-managers if there is no
~/.window-managers, or if no valid executables are found there.

This would require less code, and would provide the user with more
flexibility (rather than just *a* favorite, wmanagers could be ranked,
as they are system-wide).

This can be done in a .Xsession file too (untested code follows):

wm=
if [ -e ~/.window-managers ]; then
  for i in $(sed 's/^#.*//' ~/.window-managers) ; do
    if [ -x $i ]; then wm=$i;  break
    fi
  done
fi
if [ -z "$wm" && -e /etc/X11/window-managers ]; then
  for i in $(sed 's/^#.*//' /etc/X11/window-managers) ; do
    if [ -x $i ]; then wm=$i;  break
    fi
  done
fi
if [ -z "$wm" ]; then 
  panic!!!  # this line may need some work :-)
fi
exec $wm

-- 
Chris Waters   xtifr@dsp.net | I have a truly elegant proof of the
      or    xtifr@debian.org | above, but it is too long to fit into
http://www.dsp.net/xtifr     | this .signature file.


Reply to: