You are not logged in.
Hey everyone!
When in office, on my desk, I use my laptop to connect to 2 external monitors, I then turn off the monitor on my laptop, all with a pre-saved profile in arandr.
However, if I need to go somewhere else with the laptop, I need to open arandr again, and fallback to a laptop only monitor (all manually).
What I want to solve is the second part - I want to simply disconnect the external monitors, and as soon as there are no external monitor connected, make it fallback automatically to the laptop monitor.
The scripts I found on the wiki are good for iterating new connected monitors, however the external monitors are different (depends on the desk in the office I seat at), and can use either hdmi, mini dp or usb-c ports and different resolutions, which is why I prefer not to automate this part, and only focus on automating the fallback to laptop monitor when none of the monitors are connected.
Thanks!
Last edited by Tahvok (2022-06-11 08:40:12)
Offline
Offline
x-on-resize, as noted above, can be handy to trigger a script on connection changes, but you still need to write a script to handle each situation. And once you have a script, you may not need x-on-resize as you can bind the script to a keypress in your WM.
When I previously moved my laptop around at a job to various (and generally unknown) outputs, I had a script which handled this bound to a key press. So it didn't "automagically" adjust on every change of output connection, but I bound a display hotkey to the script so whenever I plugged / unplugged / moved about I could just hit the key and the script would run.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline