- binding super + del to suspend command
- added suspend.sh - corrected $TERMINAL assignement in startup.sh
This commit is contained in:
@@ -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
28
bin/suspend.sh
Executable 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
|
||||
|
||||
Reference in New Issue
Block a user