Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My user level: noob-ish, so please bear with me

I'm running 12.04 LTS. I have installed and, to some extent, configured xmonad 0.10

The "automagically" created xsession for it works fine as it is, but when I login it won't run a startup script I've created and "call from" /usr/share/xsessions/xmonad.desktop, if that's right. I've read pretty much all I could find about .xinitrc and .xsession, I tried that and it somehow messed up the other "sessions", if I'm explaining myself correctly. Had to $unity --reset to have the "main session" working again.

Anyway, my question is, how do I autostart xmobar and set a desktop background after login into xmonad's default Xsession?

I tried this script, start-xmonad:

#I only used one of the following each time I tried, none worked
#Also, do I really need the '&'? I know what they're for, but...
nitrogen --restore &
feh --bg-scale ~/Pictures/picture.png &

#Then I want xmobar to start, again do I need the '&'? I know it's for it to run
#in the background, but I tried removing the '&' and xmonad still launched
xmobar &

#Finally, the only thing that seems to work in this script
exec xmonad

Yes, I made sure I did chomd +x ~/start-xmonad

The xmonad.desktop is

[Desktop Entry]
Comment=Lightweight tiling window manager

So, this didn't work, now I'm here. Please help :s thanks

share|improve this question

1 Answer 1

Im a debian user but it should be the same solution for you:

I solved it like this:

(Notice .sh ending)

[Desktop Entry]
Comment=Lightweight tiling window manager

Then i made created the start-xmonad.sh file in the home folder. Commands in this file should be runnable in your terminal.

yourStartUpApplication &
xmobar &

Make sure that start-xmonad.sh has correct rights by using

chmod 755 /home/myusername/start-xmonad.sh

Note: & sign is used to run another command after.

Hope this helps! (:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.