mirror of
https://github.com/GeorgeSG/dotfiles.git
synced 2026-11-03 10:38:44 +00:00
36 lines
586 B
Bash
Executable File
36 lines
586 B
Bash
Executable File
#!/bin/sh
|
|
lock() {
|
|
|
|
# Pausing notification daemon to prevent flicker during lock.
|
|
killall -SIGUSR1 dunst
|
|
|
|
i3lock --nofork
|
|
|
|
# Resuming notifications once out of lock screen.
|
|
killall -SIGUSR2 dunst
|
|
|
|
}
|
|
|
|
case "$1" in
|
|
lock)
|
|
$HOME/.config/i3/lock.sh
|
|
;;
|
|
logout)
|
|
i3-msg exit
|
|
;;
|
|
suspend)
|
|
systemctl suspend && lock
|
|
;;
|
|
reboot)
|
|
reboot
|
|
;;
|
|
shutdown)
|
|
systemctl poweroff
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
|
|
exit 2
|
|
esac
|
|
|
|
exit 0
|