Using a custom startup script for xmonad

28 May 2014 in TIL

As lightdm doesn't call .xinitrc, I needed to find another way to start things like trayer. The easiest way is to create a file called .start-xmonad in your home directory, and point the lightdm launcher to it.

Here's what my file looks like:

bash
trayer --edge bottom --width 20 --height 22 --transparent true --tint 0x3c3b37 --alpha 0 &
dropbox start &
nm-applet &
xsetroot -cursor_name left_ptr
setxkbmap -layout uk
dconf write /org/gnome/settings-daemon/plugins/xrandr/active false
feh --bg-fill ~/Documents/current-wallpaper.png
xmonad

To make the launcher use this, I needed to edit /usr/share/xsessions/xmonad.desktop. It looks like this:

ini
[Desktop Entry]
Name=XMonad
Comment=Lightweight tiling window manager
Exec=/home/michael/.start-xmonad
Icon=xmonad.png
Type=XSession

Now, when I launch xmonad my custom setup stuff is run too