#!/usr/bin/env bash
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 -eFkl -i ~/.config/sway/background.png --font "Fira Code"
kill $SUSPEND $SCREENOFF
