swadhinbiswas Initial de-omarchy: Omarchy UI layer for Arch-based distros · 8/22/2026
9f393b2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
# omarchy:summary=Enable, disable, toggle, or recover the internal laptop display
# omarchy:args=<on|off|toggle|recover>
TOGGLE="internal-monitor-disable"
TOGGLE_FLAG="$HOME/.local/state/omarchy/toggles/hypr/$TOGGLE.lua"
MIRROR_TOGGLE="internal-monitor-mirror"
INTERNAL=$(omarchy-hyprland-monitor-laptop)
wake() {
hyprctl dispatch 'hl.dsp.dpms({ action = "enable" })' >/dev/null 2>&1 || true
}
on() {
if omarchy-hyprland-toggle-enabled $TOGGLE; then
omarchy-hyprland-toggle $TOGGLE off
omarchy-notification-send -g "Laptop display enabled"
fi
wake
}
off() {
if [[ -z $INTERNAL ]]; then
omarchy-notification-send -g "No laptop display found"
exit 1
fi
if ! omarchy-hyprland-monitor-external-active; then
omarchy-notification-send -g "Can't disable the only active display"
exit 1
fi
if omarchy-hyprland-toggle-disabled $TOGGLE && omarchy-hyprland-toggle-disabled $MIRROR_TOGGLE; then
printf 'hl.monitor({ output = "%s", disabled = true })\n' "$INTERNAL" >"$TOGGLE_FLAG"
omarchy-notification-send -g "Laptop display disabled"
hyprctl reload
fi
}
recover() {
# Runs from the clamshell watcher every few seconds, so it must be a no-op
# unless it actually re-enables a display: an unconditional wake here undoes
# lock-screen blanking and races the resume modeset into a visible flash.
omarchy-hyprland-monitor-external-active && return 0
omarchy-hyprland-toggle-enabled $TOGGLE || return 0
omarchy-hyprland-toggle $TOGGLE off
wake
}
toggle() {
if omarchy-hyprland-toggle-enabled $TOGGLE; then
on
else
off
fi
}
case "$1" in
on) on ;;
off) off ;;
toggle) toggle ;;
recover) recover ;;
*)
echo "Usage: $(basename "$0") {on|off|toggle|recover}" >&2
exit 1
;;
esac