mirror of
https://github.com/cizordj/i3-themer.git
synced 2024-04-21 12:32:12 +00:00
Now the polybar is capable of rebooting the computer on FreeBSD without needing root access
31 lines
589 B
Bash
Executable File
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
|