#!/bin/sh # Edit /etc/elogind/logind.conf and change these lines: # HandleLidSwitch=suspend -> HandleLidSwitch=lock # HandleLidSwitchExternalPower=suspend -> HandleLidSwitchExternalPower=lock swayidle -w \ timeout 300 "$HOME/.scripts/swaylock.sh" \ timeout 360 'hyprctl dispatch dpms off' \ resume 'hyprctl dispatch dpms on' \ before-sleep "$HOME/.scripts/swaylock.sh" \ lock "$HOME/.scripts/swaylock.sh"