[ADD] Common shell files

This commit is contained in:
Bruno BELANYI 2019-07-11 13:26:24 +02:00
parent d9ca7787bb
commit 795042b616
4 changed files with 152 additions and 0 deletions

38
scripts/i3exit Executable file
View file

@ -0,0 +1,38 @@
#!/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
;;
suspend)
lock && systemctl suspend
;;
hibernate)
lock && systemctl hibernate
;;
reboot)
systemctl reboot
;;
shutdown)
systemctl poweroff
;;
*)
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
exit 2
esac
exit 0