From 05d085a4f01cc0da036c1f84db5211eff98b9f3b Mon Sep 17 00:00:00 2001 From: BluishHumility Date: Fri, 13 Sep 2024 12:53:07 -0400 Subject: [PATCH] feat(power_menu.sh): add icons to menu, remove selection numbers * Add icons to menu body * Remove bracketed selection numbers now that fuzzel supports mouse selection --- .config/sway/scripts/power_menu.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.config/sway/scripts/power_menu.sh b/.config/sway/scripts/power_menu.sh index be30779..fcec0e8 100755 --- a/.config/sway/scripts/power_menu.sh +++ b/.config/sway/scripts/power_menu.sh @@ -1,33 +1,33 @@ #!/bin/bash -SELECTION="$(printf "󰌾 Lock %12s(1)\n󰤄 Suspend %9s(2)\n󰍃 Log out %9s(3)\n Reboot %10s(4)\n Reboot to UEFI %2s(5)\n󰐥 Shutdown %8s(6)" | fuzzel --dmenu -a top-right -l 6 -w 24 -x 25 -p "Select an option: ")" +SELECTION="$(printf "󰌾 Lock\n󰤄 Suspend\n󰍃 Log out\n Reboot\n Reboot to UEFI\n󰐥 Shutdown" | fuzzel --dmenu -a top-right -l 6 -w 18 -p "Select an option: ")" confirm_action() { local action="$1" - CONFIRMATION="$(printf "No %17s(1)\nYes %16s(2)" | fuzzel --dmenu -a top-right -l 2 -w 24 -x 25 -p "$action?")" + CONFIRMATION="$(printf "No\nYes" | fuzzel --dmenu -a top-right -l 2 -w 18 -p "$action?")" [[ "$CONFIRMATION" == *"Yes"* ]] } case $SELECTION in - *"Lock"*) + *"󰌾 Lock"*) swaylock;; - *"Suspend"*) + *"󰤄 Suspend"*) if confirm_action "Suspend"; then systemctl suspend fi;; - *"Log out"*) + *"󰍃 Log out"*) if confirm_action "Log out"; then swaymsg exit fi;; - *"Reboot"*) + *" Reboot"*) if confirm_action "Reboot"; then systemctl reboot fi;; - *"Reboot to UEFI"*) + *" Reboot to UEFI"*) if confirm_action "Reboot to UEFI"; then systemctl reboot --firmware-setup fi;; - *"Shutdown"*) + *"󰐥 Shutdown"*) if confirm_action "Shutdown"; then systemctl poweroff fi;;