feat(hypr): update monitor configuration and lid behavior

This commit is contained in:
2026-03-02 11:28:50 +01:00
parent 8ff188b3fa
commit a123cd42f0
8 changed files with 364 additions and 15 deletions

40
hypr/scripts/lid.sh Executable file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/env bash
set -euo pipefail
ACTION="${1:-}" # "on" oder "off"
LAPTOP="eDP-1"
LAPTOP_MODE="2256x1504"
LAPTOP_SCALE="1.175"
has_external() {
hyprctl monitors | awk '/^Monitor /{print $2}' | grep -vq "^${LAPTOP}$"
}
enable_laptop() {
hyprctl keyword monitor "${LAPTOP}, ${LAPTOP_MODE}, 0x0, ${LAPTOP_SCALE}"
hyprctl dispatch dpms on "${LAPTOP}" 2>/dev/null || true
}
disable_laptop() {
hyprctl keyword monitor "${LAPTOP}, disable"
}
case "$ACTION" in
off)
if has_external; then
disable_laptop
else
disable_laptop
hyprlock
fi
;;
on)
enable_laptop
;;
*)
echo "usage: $0 {on|off}" >&2
exit 2
;;
esac