feat: added powermenu

This commit is contained in:
2026-08-11 19:39:51 +04:00
parent 1075721046
commit 7f606a5aa6
2 changed files with 18 additions and 1 deletions
+16
View File
@@ -12,6 +12,14 @@ if [[ -n "$selection" ]]; then
elif [[ "$mode" == "notifications" ]]; then
body="${selection#*— }"
printf '%s' "$body" | wl-copy
elif [[ "$mode" == "powermenu" ]]; then
case "$selection" in
"lock") swaylock ;;
"suspend") systemctl suspend ;;
"reboot") systemctl reboot ;;
"shutdown") systemctl poweroff ;;
"logout") loginctl terminate-session "${XDG_SESSION_ID-}" ;;
esac
else
target_app=$(grep -rl "^Name=${selection}\$" /usr/share/applications/*.desktop 2>/dev/null | head -n1)
if [[ -n "$target_app" ]]; then
@@ -72,4 +80,12 @@ case "$mode" in
}
' /usr/share/applications/*.desktop 2>/dev/null
;;
powermenu)
echo -e "\0markup-rows\x1ftrue"
printf '%s\n' "<span foreground=\"#88c0d0\"></span> lock"
printf '%s\n' "<span foreground=\"#5e81ac\">󰤄</span> suspend"
printf '%s\n' "<span foreground=\"#ebcb8b\"></span> reboot"
printf '%s\n' "<span foreground=\"#bf616a\">⏻</span> shutdown"
printf '%s\n' "<span foreground=\"#b48ead\">󰗽</span> logout"
;;
esac