diff options
Diffstat (limited to '.local/bin/power.sh')
| -rwxr-xr-x | .local/bin/power.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/.local/bin/power.sh b/.local/bin/power.sh new file mode 100755 index 0000000..809e24c --- /dev/null +++ b/.local/bin/power.sh | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # Simple script to handle a DIY shutdown menu. When run you should see a bunch of options (shutdown, reboot etc.) | ||
| 4 | # | ||
| 5 | # Requirements: | ||
| 6 | # - rofi | ||
| 7 | # - systemd, but you can replace the commands for OpenRC or anything else | ||
| 8 | # | ||
| 9 | # Instructions: | ||
| 10 | # - Save this file as power.sh or anything | ||
| 11 | # - Give it exec priviledge, or chmod +x /path/to/power.sh | ||
| 12 | # - Run it | ||
| 13 | |||
| 14 | chosen=$(echo -e "lock\nshutdown\nrestart" | rofi -dmenu -i) | ||
| 15 | # Info about some states are available here: | ||
| 16 | # https://www.freedesktop.org/software/systemd/man/systemd-sleep.conf.html#Description | ||
| 17 | |||
| 18 | if [[ $chosen = "lock" ]]; then | ||
| 19 | i3lock -i ~/Dropbox/Wallpapers/current/breakfast.jpg --clock --time-font="FuraCode Nerd Font" --timesize=144 --datestr="" --timecolor=fefefeee --timestr="%H:%M" --radius=45 --timepos="ix:iy-250" | ||
| 20 | elif [[ $chosen = "shutdown" ]]; then | ||
| 21 | systemctl poweroff | ||
| 22 | elif [[ $chosen = "restart" ]]; then | ||
| 23 | systemctl reboot | ||
| 24 | fi | ||
