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:
- cd /usr/share/xsessions; cp xfce.desktop xmonad-xfce.desktop
- 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:
- 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
- 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
- Logout, you should see the xmonad-xfce in your GDM menu