Live data from Hacker News

Show HN: Change screen layout when connecting/disconnecting monitors

github.com

21–30 of 33 posts

Re: Show HN: Change screen layout when connecting/disconnecting monitors

#24
post #23

For those on Mac, Slate will do the same thing: https://github.com/jigish/slate

Actually for those on the Mac, OS X will do the same thing. It tries to at least (not 100% reliable).

"xoutputd is a daemon that monitors the connection state of outputs and then executes commands based on defined rules."

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.

Re: Show HN: Change screen layout when connecting/disconnecting monitors

#26
post #10

For 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/

Thank you for those links, I actually tried to find something like this before implementing my own solution. I guess I didn't search enough.

Re: Show HN: Change screen layout when connecting/disconnecting monitors

#27
post #2

May 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.

I use dwm on my laptop, and I have 2 external monitors.

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.

Re: Show HN: Change screen layout when connecting/disconnecting monitors

#29

For those on Mac, Slate will do the same thing: https://github.com/jigish/slate

Sadly, Slate hasn't been updated in three years and recent El Capitan releases has broken it for certain applications, most importantly iTerm2.
Post reply on HN