Added script to create .config, added script to copy Repo .config to

~/.config, started reworking README.org
This commit is contained in:
2026-03-01 22:27:54 +01:00
parent dc92033028
commit 080828620b
36 changed files with 2061 additions and 308 deletions
+25
View File
@@ -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
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -euo pipefail
OPTIONS=" Lock
 Logout (Hyprland)
 Suspend
 Hibernate
 Reboot
 Shutdown
 Cancel"
CHOICE=$(printf "%s" "$OPTIONS" | walker --dmenu )
case "$CHOICE" in
"Lock")
loginctl lock-session
;;
"Logout (Hyprland)")
hyprctl dispatch exit
;;
"Suspend")
loginctl lock-session && systemctl suspend
;;
"Hibernate")
loginctl lock-session && systemctl hibernate
;;
"Reboot")
systemctl reboot
;;
"Shutdown")
systemctl poweroff
;;
*)
exit 0
;;
esac