#!/bin/sh # Blank screen after 10 minutes # Lock after 10 minutes and 10 seconds case "$XDG_CURRENT_DESKTOP" in sway) exec /usr/bin/swayidle -w \ timeout 600 'chayang && swaymsg "output * power off"' \ timeout 610 'swaylock -f' \ resume 'swaymsg "output * power on"' \ before-sleep 'swaylock -f' \ after-resume 'swaymsg "output * power on"' ;; niri) # niri doesn't yet support single-pixel-buffers, so chayang won't work exec /usr/bin/swayidle -w \ timeout 600 'niri msg action power-off-monitors' \ timeout 610 'swaylock -f' \ before-sleep 'swaylock -f' ;; esac