Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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 file in the home folder. Commands in this file should be runnable in your terminal.

yourStartUpApplication &
xmobar &

Make sure that has correct rights by using

chmod 755 /home/myusername/

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.