<div dir="ltr">Hi,<div><br></div><div>I often use multiple displays.  Here are some configurations that I've used with my laptop:</div><div>1. Laptop monitor only</div><div>2. External monitor only (laptop lid closed)</div><div>3. External and laptop monitor at the same time.</div><div>4. Two external monitors (laptop lid closed).</div><div><br></div><div>In order to show display correctly (which monitor is to the right/left of which and which is on/off) and shift trayer around to the right monitor and position, I've written a script that parses the output of xrandr, figures out if the laptop lid is open or not, then calls xrandr again to activate the right monitors and kills and relaunches trayer and places it in the correct position.  I launch this script from a keybinding configured in xmonad.hs.</div><div><br></div><div>This works, however, it has several disadvantages.  The first is that adding a new configuration is a bit tedious -- this doesn't happen very often so it's not a huge deal.  The other is that I can only activate the script if my screen is unlocked.  This means that if my laptop is suspended and I want to disconnect the external monitor and put it in my bag for later use, I need to first wake it up, unlock it, launch the script to turn the laptop monitor on, and then put it away.  Otherwise, I'll be staring at a blank screen when I turn it on and have to guess what to press to unlock and use the script.</div><div><br></div><div>I was wondering how others deal with this challenge?  Are there other, more well-built tools, than the script I have to do this more robustly and automatically?</div><div><br></div><div>Thank you,</div><div>--<div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><font face="'courier new', monospace">There are 10 types of people, those who know binary and those who don't.</font></div></div><div><font face="'courier new', monospace"><br></font></div></div></div></div></div>