I'm running Ubuntu on a MacBook and use an external monitor. So I use xrandr to turn off the laptop monitor on startup if the external monitor is connected with this small ruby script:


display = `xrandr -q | grep DP-1`.to_s

if !display.include? "disconnected"  then
   `xrandr --output LVDS-1 --off`
   `xrandr --output DP-1 --mode 1920x1080`
   sleep 3

I use the rc.lua to star the script and a few other programms in awesome:

awful.util.spawn_with_shell("dropbox start")
awful.util.spawn_with_shell("setxkbmap de")

The monitor script works nicely but unfortunately a few of the programms are started twice such as google-chrome and nm-applet. I think that all of the programms are started twice but that the other programms such as dropbox, thunderbird and so only allow one instance. I think so because thunderbird complains about another running instance.

Is it possible that there are two instances of awesome each starting the progamms and then when the laptop monitor is deactiveted the programms are moved to the external monitor's awesome instance? Any ideas how to avoid that?


In the awesome Wiki there is a page about autostarting application. There is also an example code to force applications to run only once, see http://awesome.naquadah.org/wiki/Autostart

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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