- added custom systemd config for sleep and login.
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
This commit is contained in:
@@ -3,24 +3,27 @@ set -euo pipefail
|
||||
|
||||
INTERNAL="eDP-1"
|
||||
|
||||
# Count non-internal monitors reported by Hyprland
|
||||
external_count=$(
|
||||
hyprctl monitors | awk -v internal="$INTERNAL" '
|
||||
$1 == "Monitor" {
|
||||
name = $2
|
||||
sub(":", "", name) # strip trailing colon
|
||||
if (name != internal) {
|
||||
print name
|
||||
}
|
||||
}
|
||||
' | wc -l
|
||||
sleep 0.2
|
||||
|
||||
external_on_count=$(
|
||||
hyprctl -j monitors | jq -r --arg internal "$INTERNAL" '
|
||||
[ .[]
|
||||
| select(.name != $internal)
|
||||
| select(.disabled != true)
|
||||
| select(.dpmsStatus == true)
|
||||
] | length
|
||||
'
|
||||
)
|
||||
|
||||
# Always turn off the laptop panel on lid close
|
||||
hyprctl keyword monitor "$INTERNAL, disable"
|
||||
if [ "$external_on_count" -eq 0 ]; then
|
||||
# no external screen, we sleep
|
||||
#systemctl hybrid-sleep
|
||||
#systemctl suspend-then-hibernate
|
||||
|
||||
# Only lock if there is NO external monitor
|
||||
if [ "$external_count" -eq 0 ]; then
|
||||
hyprlock
|
||||
systemctl suspend
|
||||
#debounce hyprlock
|
||||
pgrep -x hyprlock >/dev/null || hyprlock
|
||||
else
|
||||
# docked, we turn off internal screen
|
||||
hyprctl keyword monitor "$INTERNAL, disable"
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
hyprctl keyword monitor "eDP-1, preferred, 0x0, 1"
|
||||
swayosd-server &
|
||||
hyprpaper &
|
||||
set -euo pipefail
|
||||
|
||||
INTERNAL="eDP-1"
|
||||
|
||||
sleep 0.2
|
||||
hyprctl keyword monitor "$INTERNAL, preferred, 0x0, 1"
|
||||
|
||||
pgrep -x swayosd-server >/dev/null || swayosd-server &
|
||||
pgrep -x hyprpaper >/dev/null || hyprpaper &
|
||||
|
||||
Reference in New Issue
Block a user