feat: add power menu

This commit is contained in:
doryan 2024-09-12 19:49:45 +04:00
parent b8275f2b43
commit 14cf159477

View File

@ -52,7 +52,7 @@ font-0 = "FiraCode Nerd Font:size=10;2"
modules-left = xworkspaces modules-left = xworkspaces
modules-center = xwindow modules-center = xwindow
modules-right = memory cpu pulseaudio xkeyboard wlan eth date battery modules-right = memory cpu pulseaudio xkeyboard wlan eth date battery powermenu
cursor-click = pointer cursor-click = pointer
cursor-scroll = ns-resize cursor-scroll = ns-resize
@ -163,20 +163,7 @@ label-disconnected = %{F#89A989}󰲛 %{F#707880} disconnected
[module/wlan] [module/wlan]
inherit = network-base inherit = network-base
interface-type = wireless interface-type = wireless
label-connected = %essid% %local_ip% label-connected = %{F#89A989}%ifname%%{F-} %essid% %local_ip%
format-connected = %{F#89A989}<ramp-signal> %{F-} <label-connected>
; Available tags:
; <label-disconnected> (default)
format-disconnected = <label-disconnected>
; Used when connected, but ping fails (see ping-interval)
; Available tags:
; <label-connected> (default)
; <label-packetloss>
; <animation-packetloss>
format-packetloss = <animation-packetloss> <label-connected>
ramp-signal-0 = 󰤭 ramp-signal-0 = 󰤭
ramp-signal-1 = 󰤯 ramp-signal-1 = 󰤯
@ -238,14 +225,14 @@ time-format = %H:%M
; <bar-capacity> ; <bar-capacity>
; <ramp-capacity> ; <ramp-capacity>
; <animation-charging> ; <animation-charging>
format-charging = <animation-charging> <label-charging> format-charging = <animation-charging> <label-charging>
; Available tags: ; Available tags:
; <label-discharging> (default) ; <label-discharging> (default)
; <bar-capacity> ; <bar-capacity>
; <ramp-capacity> ; <ramp-capacity>
; <animation-discharging> ; <animation-discharging>
format-discharging = <ramp-capacity> <label-discharging> format-discharging = <ramp-capacity> <label-discharging>
; Available tags: ; Available tags:
; <label-full> (default) ; <label-full> (default)
@ -329,3 +316,54 @@ screenchange-reload = true
pseudo-transparency = true pseudo-transparency = true
; vim:ft=dosini ; vim:ft=dosini
;
[module/powermenu]
type = custom/menu
expand-right = true
format-spacing = 1
label-open = " "
label-open-foreground = ${colors.urgent}
label-close =
label-close-foreground = ${colors.success}
label-separator = |
label-separator-foreground = ${colors.foreground}
;Powermenu
menu-0-0 = ""
menu-0-0-exec = menu-open-1
menu-0-0-foreground = ${colors.urgent}
menu-0-1 = "󰤆"
menu-0-1-exec = menu-open-2
menu-0-1-foreground = ${colors.urgent}
menu-0-2 = "󰤄 "
menu-0-2-exec = menu-open-3
menu-0-2-foreground = ${colors.warning}
;Reboot
menu-1-0 = "Cancel"
menu-1-0-exec = menu-open-0
menu-1-0-foreground = ${colors.success}
menu-1-1 = "Reboot"
menu-1-1-exec = loginctl reboot
menu-1-1-foreground = ${colors.urgent}
;Shutdown
menu-2-0 = "Power off"
menu-2-0-exec = loginctl poweroff
menu-2-0-foreground = ${colors.urgent}
menu-2-1 = "Cancel "
menu-2-1-exec = menu-open-0
menu-2-1-foreground = ${colors.success}
;Sleep
menu-3-0 = "Sleep"
menu-3-0-exec = loginctl suspend
menu-3-0-foreground = ${colors.urgent}
menu-3-1 = "Cancel "
menu-3-1-exec = menu-open-0
menu-3-1-foreground = ${colors.success}