mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
38 lines
918 B
Bash
Executable File
38 lines
918 B
Bash
Executable File
#!/bin/bash
|
|
|
|
TOGGLE="internal-monitor-disable"
|
|
|
|
enable() {
|
|
if omarchy-hyprland-toggle-enabled "$TOGGLE"; then
|
|
omarchy-hyprland-toggle --disabled-notification " Laptop display enabled" "$TOGGLE"
|
|
fi
|
|
}
|
|
|
|
disable() {
|
|
if omarchy-hw-external-monitors; then
|
|
if omarchy-hyprland-toggle-disabled "$TOGGLE"; then
|
|
omarchy-hyprland-toggle --enabled-notification " Laptop display disabled" "$TOGGLE"
|
|
fi
|
|
else
|
|
notify-send -u low " Can't disable the only active display"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
recover() {
|
|
if ! omarchy-hw-external-monitors && omarchy-hyprland-toggle-enabled "$TOGGLE"; then
|
|
omarchy-hyprland-toggle "$TOGGLE"
|
|
fi
|
|
}
|
|
|
|
case "$1" in
|
|
on) enable ;;
|
|
off) disable ;;
|
|
toggle) if omarchy-hyprland-toggle-enabled "$TOGGLE"; then enable; else disable; fi ;;
|
|
recover) recover ;;
|
|
*)
|
|
echo "Usage: $(basename "$0") {on|off|toggle|recover}" >&2
|
|
exit 1
|
|
;;
|
|
esac
|