#!/bin/sh

pkill -9 swayidle

exec swayidle -w \
   before-sleep 'swaylock -f' \
   timeout 360 'swaylock -f' \
   timeout 1800 'mpc status | grep "^\[playing\]" > /dev/null ||
                 swaymsg "output * dpms off"' \
        resume 'swaymsg "output * dpms on"' \
