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

I am using nm-applet to interface with NetworkManager, running xmonad as a window manager. My X sessions (including nm-applet) are set up with a /usr/local/bin/xmonad.start script.

My question is, how can I keep nm-applet running in the background as long as X is running, but not necessarily xmonad? As mentioned above, it is being started with xmonad (and dying with it when xmonad is restarted, etc).

I am using gdm to manage my X sessions, and I'm running 10.10. Where's a good place to start nm-applet to suit my particular needs? I need to remove it from the control of xmonad, but don't know where to start it otherwise.

Any help, tips, etc appreciated.

Edit: problem seems to be with how I have integrated xmonad. I have the session script as a file in /usr/share/xsessions/xmonad.desktop with the following contents:

[Desktop Entry]
Comment=Lightweight tiling window manager

/usr/local/bin/xmonad.start contains the following:


xrdb -merge ~/.Xresources
xcompmgr -c &

trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --width 8 --heighttype pixel --height 18 --transparent true --alpha 0 --tint 0x000000 &

gnome-settings-daemon &
gnome-screensaver &

if [ -x /usr/bin/nm-applet ] ; then
    nm-applet --sm-disable &

/usr/bin/urxvtd -q -o -f &
eval `ssh-agent` &

if [ -x /usr/bin/gnome-power-manager ] ; then
    sleep 1
    gnome-power-manager &

/usr/bin/gnome-volume-control-applet &
exec xmonad

The question is how do I integrate xmonad, gdm, X, etc in such a manner to replicate the behavior I currently have except with nm-applet (and possibly other programs) running whether or not xmonad is?

share|improve this question
If I understand your question correctly, what you might want to investigate is just replacing the current WM with the desired one. Some WMs honor --replace, but often you can just kill the current one and manually invoke the desired one. In such a fashion you don't need to worry about losing NM since you're still in the same session (NM is tied to your user session). – Daniel T Chen Nov 24 '10 at 11:46
Yes, but in this case, xmonad is the entire desktop environment, as it were, not just the window manager. Also, while there is a way to recompile and restart xmonad without exiting, sometimes windowing artifacts make me have to 'forcibly' restart the WM by quitting and starting a new session. – Sam Halicke Nov 25 '10 at 18:46

I always thought that if you put that information in your ~/.xsession then you do not get that problem, that way you start nm-applet before xMonad. I know that my nm-applet does not seem to restart when I restart xMonad. (I can paste my startup script here later if you want to take a look)

share|improve this answer
Please have a look at my edited question. – Sam Halicke Nov 25 '10 at 18:46

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.