dot-files/scripts/i3exit

42 lines
828 B
Plaintext
Raw Normal View History

2019-07-11 13:26:24 +02:00
#!/bin/sh
function lock() {
# Date and time parameters
x_pos=100
y_pos=1040
datetime_color=FFFFFF80
2019-07-11 13:26:24 +02:00
i3lock -i ~/Pictures/wallpapers/roundabout-blues.png --force-clock \
--timepos="$x_pos:$y_pos" \
--timecolor="$datetime_color" \
--datecolor="$datetime_color"
2019-07-11 13:26:24 +02:00
}
case "$1" in
lock)
lock # Defined in the same folder
;;
logout)
i3-msg exit
;;
switch_user)
dm-tool switch-to-greeter
;;
2019-07-11 13:26:24 +02:00
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}"
2019-07-11 13:26:24 +02:00
exit 2
esac
exit 0