I have a little python script to do a similar thing: https://github.com/larkery/nix-session/blob/master/scripts/d... This remembers the randr state that's associated with plugged in displays by their EDID and the ACPI lid switch. When you change the randr state, it remembers it, and when you change what displays are connected or open the laptop lid, it loads a previously remembered state if there is one. The state sa…
Show HN: Change screen layout when connecting/disconnecting monitors
11–20 of 33 posts
Re: Show HN: Change screen layout when connecting/disconnecting monitors
#12TL;DR: Replace "LDADD+= -ll -ly -lX11 -lXrandr" with "LDADD+= -lfl -lX11 -lXrandr" to make it compile on Gentoo. Make sure yacc and flex are emerged.
Re: Show HN: Change screen layout when connecting/disconnecting monitors
#13I have a little python script to do a similar thing: https://github.com/larkery/nix-session/blob/master/scripts/d... This remembers the randr state that's associated with plugged in displays by their EDID and the ACPI lid switch. When you change the randr state, it remembers it, and when you change what displays are connected or open the laptop lid, it loads a previously remembered state if there is one. The state sa…
I used a bash script to do this, until I got a laptop that has only a mini-display port. Now I don't/can't connect to anything :(
Re: Show HN: Change screen layout when connecting/disconnecting monitors
#14May I ask what desktop environment you use, and what you usually use this for? I ask because a good DE should remember the settings pertaining to each monitor configuration (display positions of course, but also things like panels placed in secondary monitors). I've been using Plasma (KDE) for about a year and it handles this reasonably well.
Gnome doesn't do this. Without fail, every time, it puts the dock on the wrong external display. Every. Time.
Re: Show HN: Change screen layout when connecting/disconnecting monitors
#15Re: Show HN: Change screen layout when connecting/disconnecting monitors
#16May I ask what desktop environment you use, and what you usually use this for? I ask because a good DE should remember the settings pertaining to each monitor configuration (display positions of course, but also things like panels placed in secondary monitors). I've been using Plasma (KDE) for about a year and it handles this reasonably well.
Re: Show HN: Change screen layout when connecting/disconnecting monitors
#17Re: Show HN: Change screen layout when connecting/disconnecting monitors
#18For reference, there's also autorandr [1] and x-on-resize [2]. [1] https://github.com/wertarbyte/autorandr [2] http://keithp.com/blogs/x-on-resize/
x-on-resize looks like a good alternative to xoutputd though. It's probably worth to take a closer look at it and use the one whose code is simpler and easier to read.
Re: Show HN: Change screen layout when connecting/disconnecting monitors
#19KDE does this automatically. I'd guess there is similar functionality for other DEs too.
Re: Show HN: Change screen layout when connecting/disconnecting monitors
#20For reference, there's also autorandr [1] and x-on-resize [2]. [1] https://github.com/wertarbyte/autorandr [2] http://keithp.com/blogs/x-on-resize/