.files/.local/bin/lock

12 lines
412 B
Bash
Executable File

#!/usr/bin/env bash
if ! ps aux | grep -v grep | grep swaylock; then
# if [[ $(playerctl status) != "Playing" ]]; then
# swayidle -w timeout 600 'sudo ~/.local/bin/__suspend' &
# SUSPEND=$!
# fi
swayidle -w timeout 15 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' &
SCREENOFF=$!
swaylock
kill $SUSPEND $SCREENOFF
fi