Switch to gtlock, screenlock improvements

This commit is contained in:
Aleksey Samoilov 2025-06-04 10:53:15 +04:00
parent 53151b82fd
commit d023b91db4
3 changed files with 29 additions and 11 deletions

View file

@ -1,6 +1,8 @@
timeout 240 'light -G > /tmp/brightness && light -S 10' resume 'light -S $([ -f /tmp/brightness ] && cat /tmp/brightness || echo 100%)' timeout 240 'brightnessctl -s && brightnessctl set 10' resume 'brightnessctl -r'
timeout 300 ~/.config/swaylock/lock.sh timeout 300 '/usr/share/river/scripts/lock.sh'
timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' timeout 600 '/usr/share/river/scripts/kbd-backlight.sh off && timeout 600 'wlopm --off \*' resume '/usr/share/river/scripts/kbd-backlight.sh on && 'wlopm --on \*'
timeout 900 '[ "$(acpi -b | grep Discharging)" != "" ] && systemctl suspend'
timeout 3600 '[ "$(acpi -b | grep Discharging)" = "" ] && systemctl suspend'
before-sleep 'playerctl pause' before-sleep 'playerctl pause'
before-sleep ~/.config/swaylock/lock.sh before-sleep '/usr/share/river/scripts/lock.sh && sleep 2'
lock ~/.config/swaylock/lock.sh after-resume '/usr/share/river/scripts/kbd-backlight.sh on && 'wlopm --on \*' && brightnessctl -r'

View file

@ -0,0 +1,11 @@
#!/usr/bin/env sh
set -x
case $1'' in
'on')
brightnessctl -r -d "*kbd_backlight"
;;
'off')
brightnessctl -s -d "*kbd_backlight" && brightnessctl -d "*kbd_backlight" set 0
;;
esac

View file

@ -1,10 +1,15 @@
#!/bin/bash #!/bin/bash
USER_SCRIPT="$HOME/.config/swaylock/lock.sh" # Swaylock run's with additional features, e.g. adding screenshot to background
GLOB_SCRIPT="/usr/share/sway/scripts/swaylock.sh" SWAYLOCK_USER_SCRIPT="$HOME/.config/swaylock/lock.sh"
SWAYLOCK_GLOB_SCRIPT="/usr/share/river/scripts/swaylock.sh"
if [[ -x "$USER_SCRIPT" ]]; then if [ -x "$(command -v gtklock)" ]; then
"$USER_SCRIPT" gtklock --daemonize --follow-focus --idle-hide --start-hidden
elif [ -x "$(command -v swaylock)" ]; then
if [[ -x "$SWAYLOCK_USER_SCRIPT" ]]; then
"$SWAYLOCK_USER_SCRIPT"
else else
"$GLOB_SCRIPT" "$SWAYLOCK_GLOB_SCRIPT"
fi
fi fi