From 6a3065f9475e1547a671296759416404c10387c5 Mon Sep 17 00:00:00 2001 From: Laurent Le Houerou Date: Mon, 3 Jun 2024 13:03:14 +0400 Subject: [PATCH] add menu for shutdown & reboot to polybar --- polybar/.config/polybar/config.ini | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/polybar/.config/polybar/config.ini b/polybar/.config/polybar/config.ini index 5539f88..94c4b60 100644 --- a/polybar/.config/polybar/config.ini +++ b/polybar/.config/polybar/config.ini @@ -79,7 +79,7 @@ font-0 = FiraCode Nerd Font Mono;2 font-1 = Symbols Nerd Font;2 modules-left = xworkspaces -modules-right = filesystem pulseaudio-control-output memory cpu wlan date systray +modules-right = filesystem pulseaudio-control-output memory cpu wlan date systray powermenu cursor-click = pointer cursor-scroll = ns-resize @@ -92,6 +92,29 @@ enable-ipc = true ; override-redirect = true + +[module/powermenu] +type = custom/menu + +label-open = %{T2}%{T-} +label-close = %{T2}%{T-} +label-open-foreground = ${colors.text} +label-open-padding = 1 +label-separator = " | " +label-padding = 2 + +menu-0-0 = %{T2}%{T-} +menu-0-0-exec = confirm "Shutdown now?" && shutdown now +menu-0-0-foreground = ${colors.alert} + +menu-0-1 = %{T2}%{T-} +menu-0-1-exec = confirm "Reboot now?" && reboot +menu-0-1-foreground = ${colors.yellow} + + + + + [module/systray] type = internal/tray