dot-files/scripts/i3exit
Bruno BELANYI 8b6840e2ac [UPDATE][SCRIPT] Handle switch_user in i3exit
Also switched from tabulation to spaces as indentation.
2019-10-18 22:17:20 +02:00

42 lines
828 B
Bash
Executable file

#!/bin/sh
function lock() {
# Date and time parameters
x_pos=100
y_pos=1040
datetime_color=FFFFFF80
i3lock -i ~/Pictures/wallpapers/roundabout-blues.png --force-clock \
--timepos="$x_pos:$y_pos" \
--timecolor="$datetime_color" \
--datecolor="$datetime_color"
}
case "$1" in
lock)
lock # Defined in the same folder
;;
logout)
i3-msg exit
;;
switch_user)
dm-tool switch-to-greeter
;;
suspend)
lock && systemctl suspend
;;
hibernate)
lock && systemctl hibernate
;;
reboot)
systemctl reboot
;;
shutdown)
systemctl poweroff
;;
*)
echo "Usage: $0 {lock|logout|switch_user|suspend|hibernate|reboot|shutdown}"
exit 2
esac
exit 0