From 00e4e889cd5864156a737318669303f2f775cafe Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Sun, 22 Feb 2026 23:31:46 +0100 Subject: 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 --- roles/hyprland/files/scripts/power.sh | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 roles/hyprland/files/scripts/power.sh (limited to 'roles/hyprland/files/scripts') 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 -- cgit v1.2.3