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-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-scroll = ns-resize
@ -163,20 +163,7 @@ label-disconnected = %{F#89A989}󰲛 %{F#707880} disconnected
[module/wlan]
inherit = network-base
interface-type = wireless
label-connected = %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>
label-connected = %{F#89A989}%ifname%%{F-} %essid% %local_ip%
ramp-signal-0 = 󰤭
ramp-signal-1 = 󰤯
@ -329,3 +316,54 @@ screenchange-reload = true
pseudo-transparency = true
; 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}