[xmonad] Managing Multiple Displays

Eyal Erez oneself at gmail.com
Fri Jul 9 14:14:54 UTC 2021


Hi,

I often use multiple displays.  Here are some configurations that I've used
with my laptop:
1. Laptop monitor only
2. External monitor only (laptop lid closed)
3. External and laptop monitor at the same time.
4. Two external monitors (laptop lid closed).

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.

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.

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?

Thank you,
--
There are 10 types of people, those who know binary and those who don't.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/xmonad/attachments/20210709/4bf3d06c/attachment.html>


More information about the xmonad mailing list