#!/bin/sh pid="$(pgrep swayidle)" if [ -z "$pid" ]; then swayidle -w timeout 300 lock & notify-send -t 3000 --app-name "Autolock" "Enabled" else kill -9 "$pid" notify-send -t 3000 --app-name "Autolock" "DISABLED" fi