diff options
| author | Ahmed Abdelhalim <[email protected]> | 2026-02-22 23:31:46 +0100 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2026-02-22 23:37:08 +0100 |
| commit | 00e4e889cd5864156a737318669303f2f775cafe (patch) | |
| tree | 2f61023fce1c0ab1a707f97845373b167a1169c0 /roles/hyprland/files/scripts | |
| parent | 60a3569f673b53f54a360340e9e57ab4caa5f391 (diff) | |
Configure power menu using tofi
Since it was almost impossible to change the spacing between the gum
choose items, I used tofi instead, which is already themed and the only
downside to it, is that it allows typing input on the menu which isn't
my favorite but it's also not bad at all
Diffstat (limited to 'roles/hyprland/files/scripts')
| -rwxr-xr-x | roles/hyprland/files/scripts/power.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/roles/hyprland/files/scripts/power.sh b/roles/hyprland/files/scripts/power.sh new file mode 100755 index 00000000..77e37626 --- /dev/null +++ b/roles/hyprland/files/scripts/power.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Use the commented styling to get tofi fullscreen theme instead of +# using the hpyrland windowrule workaround to get the dimming effect + # --width 100% \ + # --height 120% \ + # --font-size 20 \ + # --anchor center \ + # --border-width 0 \ + # --outline-width 0 \ + # --padding-top 50% \ + # --padding-left 42% \ + # --result-spacing 10 \ + # --placeholder-text "" \ + # --prompt-text "Power:" \ + # --background-color "#000B" +ACTION=$(printf ' Shutdown\n Reboot\n Suspend' | tofi \ + --width 450 \ + --height 300 \ + --font-size 20 \ + --anchor center \ + --prompt-text "Power:" \ + --placeholder-text "" \ + --result-spacing 10 +) + + +case "$ACTION" in + *Shutdown*) + hyprctl dispatch exec hyprshutdown --no-fork -t "Shutting down..." --post-cmd "systemctl poweroff" + ;; + *Reboot*) + hyprctl dispatch exec hyprshutdown --no-fork -t "Restarting..." --post-cmd "systemctl reboot" + ;; + *Suspend*) + loginctl lock-session && systemctl suspend + ;; +esac |
