Ensure internal display is turned back on if the external one is disconnected

This commit is contained in:
David Heinemeier Hansson
2026-04-19 17:11:48 +02:00
parent bdead4a3d1
commit d6aaf30e43
5 changed files with 33 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
# Listen on Hyprland's event socket and recover the internal display whenever
# a monitor is removed.
SOCKET="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
socat -U - "UNIX-CONNECT:$SOCKET" | while read -r event; do
case "$event" in
monitorremoved\>\>*|monitorremovedv2\>\>*)
omarchy-hyprland-monitor-internal-recover
;;
esac
done