dotfiles/home/.config/sway/scripts/idle.sh
2020-04-17 10:36:41 +03:00

13 lines
403 B
Bash
Executable file

#!/bin/bash
swaylock="$HOME/.config/sway/scripts/lock.sh"
screenon="swaymsg 'output * dpms on'"
screenoff="swaymsg 'output * dpms off'"
swayidle \
lock "$swaylock" \
unlock "pkill -9 swaylock" \
timeout 300 "lqsd -d" \
resume "lqsd -r" \
timeout 600 "loginctl lock-session" \
timeout 610 "$screenoff" \
resume "$screenon; lqsd -r" \
before-sleep "playerctl pause; loginctl lock-session" \