Show HN: Change screen layout when connecting/disconnecting monitors
github.com
github.com
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.
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 saving and loading is done by arandr, which handles the resolution, position, and choice of primary output.
TL;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.
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.
Every morning I had to make an xrandr call when I plugged them, and another one at the end of the day when I unplugged them to make my window manager aware of my screen layout.
I was tired so I automated the thing.
https://github.com/rndstr/dotfiles/blob/master/bin/monitor-h...
I'm not aware of anything built in to OS X that allows you to execute scripts to perform custom actions when displays are connected/disconnected. OS X just tries to replicate the last layout you had.
* Plugged into your desk monitor? You can have Slate hide Steam and put MacVim & iTerm side by side. * Plugged into your TV? You can have Slate run a script to make sure your Plex server is up and then full-screen your browser. * Etc.