- binding super + del to suspend command

- added suspend.sh
- corrected $TERMINAL assignement in startup.sh
This commit is contained in:
2026-02-14 11:52:58 +01:00
parent a7339279a1
commit 1b565a9a82
3 changed files with 31 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
export $TERMINAL=weztzerm
export TERMINAL=weztzerm
source /home/thierry/keepass.env
source /home/thierry/bin/alias

28
bin/suspend.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
pgrep -x hyprlock >/dev/null || hyprlock &
systemctl suspend-then-hibernate
sleep 2
INTERNAL="eDP-1"
external_on_count=$(
hyprctl -j monitors | jq -r --arg internal "$INTERNAL" '
[ .[]
| select(.name != $internal)
| select(.disabled != true)
| select(.dpmsStatus == true)
] | length
'
)
if [ "$external_on_count" -eq 0 ]; then
# no external screen, we enable internal screen
hyprctl keyword monitor "$INTERNAL, 1920x1080@120, 0x0, 1"
else
# external monitor active, we turn off internal screen
hyprctl keyword monitor "$INTERNAL, disable"
fi