This is the content of my ~/.xsession:


# Tray for skype, keyboard layout, ...
trayer --edge top --align right --SetDockType true --SetPartialStrut true  --expand true --width 10 --transparent true --tint 0x686868 --height 17 &

# Keyboard layout switcher
setxkbmap -layout us,se -option 'grp:alt_shift_toggle' &

xscreensaver -nosplash &

After login with xmonad selected in lightdm, xscreensaver is not running, neither is trayer, and setxkbmap is not setup.

I have seen this question, which is exactly the same, but the answers there did not help:

  • ~/.xsession is executable for all
  • I have no option "Custom session" in the login manager (Ubuntu's default)

1 Answer 1


It turns out I had created my own start script xmonad-start.sh, and changed /usr/share/xsessions/xmonad.desktop's Exec line to run this script. I still quite don't get why X wouldn't run ~/.xsession whatever the WM, but adding ~/.xsession to my script xmonad-start.sh worked.

This question helped.

In my fresh installation (Ubuntu 15.10 and xmonad from apt-get), this is how it works:

  • /usr/share/xsessions/xmonad.desktop is what is called upon login with lightdm
  • this in turn has the row Exec=xmonad-session
  • xmonad-session is in /usr/bin, and sources .xmonad/xmonad-session-rc if it exists.

So you can just create a symbolic link ~/.xmonad/xmonad-session-rc to wherever your start script is.

No tinkering in files that are not the user's.

  • On Centos7, /usr/bin/xmonad-start looks for a ~/.xmonad/session file to load (among others). Moving ~/.xsession to ~/.xmonad/session (or symlinking) works.
    – Kirk
    Jul 20, 2016 at 15:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .