Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

Monthly Archives: December 2012

Add xmonad-xfce to gdm

It is easy to find instructions of how to make xfce to use xmonad as window manager. However there is no article I aware that adding a xmonad-xfce to GDM, yet keeping the original XFce.

Step by step:

As root:

  1. cd /usr/share/xsessions; cp xfce.desktop xmonad-xfce.desktop
  2. Edit xmonad-xfce.desktop and make following to change
    a. Search Xfce and replace with Xmonad-Xfce (case sensitive)
    b. Change the line Exec=…. to Exec=PREF_WM=xmonad startxfce4

As normal user:

  1. Having a a following script file, assume its name is ifvar
    VAR_NAME=$1
    VAR=$(eval echo \$${VAR_NAME})
    THEN_CMD="$2"
    ELSE_CMD="$3"
    
    if [ -n "${VAR}" ]; then
    	eval ${THEN_CMD}
    else
    	eval ${ELSE_CMD}
    fi
  2. Edit ${HOME}/.config/autostart/WM_Selector.desktop as following
    Encoding=UTF-8
    Version=0.9.4
    Type=Application
    Name=WM selector
    Comment=Window manager selector
    Exec=ifvar PREF_WM "exec ${PREF_WM} &" "exec /usr/bin/xfwm4 &"
    StartupNotify=false
    Terminal=false
    Hidden=false
  3. Logout, you should see the xmonad-xfce in your GDM menu
Advertisements