You are not logged in.

#1 2022-06-11 08:39:33

Tahvok
Member
Registered: 2014-04-13
Posts: 8

How to fallback to laptop monitor when no other monitors are connected

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

#2 2022-06-11 12:05:33

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,582

Re: How to fallback to laptop monitor when no other monitors are connected

Offline

#3 2022-06-11 12:11:55

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,480
Website

Re: How to fallback to laptop monitor when no other monitors are connected

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

Board footer

Powered by FluxBB