Files
i3-themer/i3-exit
T
cizordj d6e3c81ace Update i3-exit
Now the polybar is capable of rebooting the computer on FreeBSD without
needing root access
2021-02-14 14:49:33 -03:00

31 lines
589 B
Bash
Executable File

#!/bin/sh
printHelp(){
echo "Usage: i3-exit {lock|logout|reboot|shutdown}"
}
lock(){
screenshot="/tmp/qI5MkdEu.png"
screenshotblur="/tmp/Vur4EooC.png"
import -window root "$screenshot"
convert "$screenshot" -blur 0x5 "$screenshotblur"
rm "$screenshot"
i3lock -i "$screenshotblur"
xset dpms force off
}
case "$1" in
lock)
lock ;;
logout)
i3-msg exit ;;
reboot)
systemctl reboot || doas /sbin/reboot
;;
shutdown)
systemctl poweroff || doas /sbin/poweroff
;;
*)
printHelp ;;
esac