configs/arch-config/.config/sway/sway-scripts/exit.sh

28 lines
460 B
Bash
Raw Normal View History

2023-11-24 17:04:03 +01:00
#!/usr/bin/env sh
2020-03-04 13:28:42 +01:00
case "$1" in
lock)
2023-11-24 17:04:03 +01:00
swaylock -f -e -i "$HOME/.cache/backgrounds/lockscreen"
2020-03-04 13:28:42 +01:00
;;
logout)
2023-11-24 17:04:03 +01:00
swaymsg exit
2020-03-04 13:28:42 +01:00
;;
suspend)
systemctl suspend
2020-03-04 13:28:42 +01:00
;;
hibernate)
2023-11-24 17:04:03 +01:00
exit 1
2020-03-04 13:28:42 +01:00
;;
reboot)
systemctl reboot
;;
shutdown)
systemctl poweroff
;;
*)
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
exit 2
esac
exit 0