Renamed system-master into henrovnix

This commit is contained in:
2026-02-23 17:57:21 +01:00
parent 922d3241ce
commit caefb3c0f4
8843 changed files with 107078 additions and 0 deletions
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail
INTERNAL="eDP1"
has_external() {
# Any monitor name that is not INTERNAL counts as external
hyprctl monitors -j | grep -q '"name"' && ! hyprctl monitors -j | grep -q "\"name\":\"$INTERNAL\"\""
}
has_external_robust() {
# robust without jq: count monitor names; if there's >1 OR there's a name not INTERNAL
local names
names="$(hyprctl monitors -j | sed -n 's/.*"name":"\([^"]*\)".*/\1/p')"
# if any name != INTERNAL then external
echo "$names" | grep -vx "$INTERNAL" >/dev/null 2>&1
}
if has_external_robust; then
# Clamshell: disable laptop panel, no lock
hyprctl keyword monitor "${INTERNAL},disable"
else
# Laptop only: suspend
systemctl suspend
fi
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
INTERNAL="eDP1"
# Restore panel using preferred mode, auto position, scale 1
hyprctl keyword monitor "${INTERNAL},preferred,auto,1"