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

policy for window managers



I maintain KDE, which includes a window manager, and I've been wondering how
other window managers handle registering themselves in
/etc/X11/window-managers. So I took a look at all th window managers.

Some window managers add themselves to the top of the file, so they become the
default window manager. Others add themselves to the bottom of the file, so
the sysadmin doesn't get a chance to use them as a default window manager
without editing the file. And many window managers don't add themselves to the
file at all.

Here's a survey I did:

window manager    adds itself to /etc/X11/window-managers how
--------------    -------------------------------------------
kde               adds to bottom
afterstep         adds to bottom
fvwm              doesn't do so
fvwm2             doesn't seem to do so (complex postinst, I just grepped it :-)
fvwm95            adds to top
gwm               doesn't do so
9wm               doesn't do so
ctwm              doesn't do so
wm2               doesn't do so
wmaker            doesn't do so
olvwm             if olvwm entry not already present, prompt to make 
                  default window manager or not, insert line in appropriate 
                  place.

I think olvwm's behavior is the best of the lot, since it gives the sysadmin
a choice (and only asks once, not during upgrades, which is also very good
behavior). I wonder if it'd be a good idea for one of the X packages to
include a register-window-manager script that could be called from the
postinst's to handle this, so all window managers functioned exactly alike?

Here's the code from olvwm's postinst:

# add olvwm to /etc/X11/window-managers
if ! grep -q /usr/X11R6/bin/olvwm /etc/X11/window-managers; then
    echo -n "Make olvwm the default window manager? [Y] "
    read yn
    test -n "$yn" || yn="Y"

    case "$yn" in
        [Nn]*)
                # append olvwm line to the end
                echo "/usr/X11R6/bin/olvwm" >>/etc/X11/window-managers
                ;;
        *)
                # insert olvwm line after initial comments
                cp /etc/X11/window-managers /tmp/$$
                perl -e 'print while ($_ = <>) =~ /^#/; \
                         print "/usr/X11R6/bin/olvwm\n"; \
                         print; \                                
                         print while <>;' <//tmp/$$ >/etc/X11/window-managers
                rm /tmp/$$
                ;;
        esac
fi      

-- 
see shy jo


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: