Those scripts should be placed in /etc/systemd/ in case of a restore on the laptop - strengthened the lid_close and lid_open scripts to debounce and not handle sleep - switched from deep sleep to s2idle, so that resume is not immediate - hibernating after 30 minutes of s2idle state - themed fuzzel with dracula - cleaned up hyprland comments on lid close/open - removed splash from hyprpaper config
30 lines
583 B
Bash
Executable File
30 lines
583 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
INTERNAL="eDP-1"
|
|
|
|
sleep 0.2
|
|
|
|
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 sleep
|
|
#systemctl hybrid-sleep
|
|
#systemctl suspend-then-hibernate
|
|
|
|
#debounce hyprlock
|
|
pgrep -x hyprlock >/dev/null || hyprlock
|
|
else
|
|
# docked, we turn off internal screen
|
|
hyprctl keyword monitor "$INTERNAL, disable"
|
|
fi
|
|
|