[UPDATE][SCRIPT] Handle switch_user in i3exit

Also switched from tabulation to spaces as indentation.
This commit is contained in:
Bruno BELANYI 2019-10-03 18:59:50 +02:00
parent 7ebee08f4e
commit 8b6840e2ac

View file

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