Handle clamshell monitor hotplug

This commit is contained in:
David Heinemeier Hansson
2026-06-22 21:48:35 +02:00
parent 4772f01148
commit ee65304b92
6 changed files with 72 additions and 16 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
# omarchy:summary=Returns true when clamshell mode is active
# omarchy:hidden=true
lid_closed=false
for state in /proc/acpi/button/lid/*/state; do
[[ -r $state ]] || continue
if [[ $(< "$state") == *"closed"* ]]; then
lid_closed=true
break
fi
done
[[ $lid_closed == "true" ]] && omarchy-hw-external-monitors