mirror of
https://github.com/olexsmir/dotfiles.git
synced 2026-01-15 08:41:34 +02:00
add power menu for hyprland using wofi
This commit is contained in:
parent
e8159232c1
commit
76014299e8
1 changed files with 25 additions and 0 deletions
25
bin/wofi-power-menu
Executable file
25
bin/wofi-power-menu
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/env bash
|
||||
|
||||
entries="⇠ logout\n⏾ suspend\n⭮ reboot\n⏻ poweroff"
|
||||
selected=$(echo -e "$entries" |
|
||||
wofi --dmenu --cache-file /dev/null |
|
||||
awk '{print tolower($2)}')
|
||||
|
||||
shall_continue() {
|
||||
entries="Yes\nNo"
|
||||
selected=$(echo -e "$entries" |
|
||||
wofi --dmenu --cache-file /dev/null |
|
||||
awk '{print tolower($1)}')
|
||||
|
||||
case $selected in
|
||||
yes) exec "$@" ;;
|
||||
no) exit 0 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
case $selected in
|
||||
logout) shall_continue hyprctl dispatch exit ;;
|
||||
suspend) shall_continue systemctl suspend ;;
|
||||
rebbot) shall_continue systemctl reboot ;;
|
||||
poweroff) shall_continue systemctl poweroff ;;
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue