it use like arrays :: '
; If true, <label-toggle> will be to the left of the menu items (default). ; If false, it will be on the right of all the items
"menu-LEVEL-N" has the same properties as "label-NAME" with ; the additional "exec" property
; Commands will be executed using "/bin/sh -c $COMMAND"
; Available tags:
; <label-toggle> (default) - gets replaced with <label-(open|close)>
; <menu> (default)
; If expand-right is true, the default will be "<label-toggle><menu>" and the
; other way around otherwise.
; Note that if you use <label-toggle> you must also include
; the definition for <label-open>
; format = <label-toggle><menu>
first menu starts with 0 ::
[module/menxx]
type = custom/menu
expand-right = true
label-open =shortcut
label-close = close
---------------------------------------------------------------
syntax menu-LEVEL-N
#define first menu root menu it can be opened with menu-open-0
menu-0-0 = menu1
menu-0-0-exec = menu-open-1
#define second menu item
menu-0-1 = menu2
menu-0-1-exec = menu-open-2
#define third menu item
menu-0-2 = menu3
menu-0-2-exec= menu-open-3
#define Nth menu item
menu-0-(N-1) = menuN
menu-0-(N-1)-exec= menu-open-N
## define menu1 ###
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
## on pressing this open root menu
menu-1-1 = reboot
menu-1-1-exec = reboot
.......
......
menu-1-N=somelabel
menu-1-N-exec=someaction
##define menu2 ##
menu-2-0 = power off
menu-2-0-exec = poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
----
---
menu-2-N= somelabel
menu-2-N-exec= someaction
###define menu 3 ###
menu-3-0=simple terminal
menu-3-0-exec= st
---------------------------------------------------------------------------------------
powermenu
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = reboot
menu-2-0 = power off
menu-2-0-exec = poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
---------------------------------
note
1d didnt work i.e menu-0 xxx and menu-0-exec xxx didnt work 2d works
menu-0-0=st
menu-0-0-exec= st
menu-0-1=pavucontrol
menu-0-1-exec=pavucontrol
this works on single click
--------------------------------------
my polybar
[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
;pseudo-transparency = false
[colors]
#background = ${xrdb:color0:#222}
background = ${xrdb:background:#aa000000}
background-alt = ${xrdb:color8:#000}
;foreground = ${xrdb:color7:#222}
foreground = ${xrdb:foreground:#dfdfdf}
foreground-alt = ${xrdb:color7:#444}
primary = ${xrdb:color4:#ffb52a}
secondary = ${xrdb:color7:#e60053}
alert = ${xrdb:color1:#bd2c40}
[global/wm]
margin-top = 0
margin-bottom = 0
[bar/top]
;monitor = ${env:MONITOR:HDMI-1}
width = 100%
height = 30
offset-x = 0%
offset-y = 0
radius = 0
fixed-center = true
bottom=false
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
border-size = 4
border-color = #00000000
padding-left = 0
padding-right = 2
module-margin-left = 1
module-margin-right = 2
font-0 = KoHo SemiBold:style=Regular:size=12;0
font-1 = Unifont:size=10:style=Medium;0
font-2 = FontAwesome:style=Regular:size=14
font-3 = Weather Icons:size=14;1
font-4 = Source Code Pro:size=14;0
modules-left = i3 xwindow
modules-center = pulseaudio date xbacklight
modules-right = memory xkeyboard wlan eth battery powermenu
wm-restack = i3
;override-redirect = true
;scroll-up = i3wm-wsnext
;scroll-down = i3wm-wsprev
cursor-click = pointer
cursor-scroll = ns-resize
[module/dmenurecord]
type = custom/script
exec=cat /tmp/recordingicon
exec-if = [ -p /tmp/recordingicon ]
[module/xwindow]
type = internal/xwindow
label = %title:0:20:...%
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
;pin-workspaces = true
label-mode-padding = 2
label-mode-foreground = #000
label-mode-background = ${colors.primary}
; focused = Active workspace on focused monitor
label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2
; unfocused = Inactive workspace on any monitor
label-unfocused = %index%
label-unfocused-padding = 2
; visible = Active workspace on unfocused monitor
label-visible = %index%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}
; urgent = Workspace with urgency hint set
label-urgent = %index%
label-urgent-background = ${colors.alert}
label-urgent-padding = 2
; Separator in between workspaces
; label-separator = |
[module/xbacklight]
type = internal/backlight
card = intel_backlight
format = <ramp> <label>
label = %{A3:exec lxrandr:} %percentage%%%{A}
enable-scroll = true
ramp-0 = 🌕
ramp-1 = 🌔
ramp-2 = 🌓
ramp-3 = 🌒
ramp-4 = 🌑
[module/date]
type = internal/date
interval = 1
date =" %A %d %B %Y"
date-alt = " %m/%d"
time-alt = %I:%M %p
time = %I:%M:%S %p
format-prefix =
format-prefix-foreground = ${colors.foreground-alt}
label = %date% %time%
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <ramp-volume> <label-volume>
label-volume = %percentage%%
label-volume-foreground = ${root.foreground}
label-muted = muted
label-muted-foreground = ${xrdb:color7:#666}
ramp-volume-0 =
ramp-volume-1 =
ramp-volume-2 =
click-right = pavucontrol
[module/memory]
type = internal/memory
label = RAM %gb_used%
; Seconds to sleep between updates
; Default: 1
interval = 3
[module/xkeyboard]
type = internal/xkeyboard
;blacklist-0 = num lock
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-prefix-underline = ${colors.secondary}
label-layout = %layout%
label-layout-underline = ${colors.secondary}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.secondary}
label-indicator-underline = ${colors.secondary}
[module/wlan]
type = internal/network
interface = wlan0
interval = 3.0
format-connected = <ramp-signal><label-connected>
format-connected-underline = #9f78e1
label-connected = %{A1:exec st -e iwctl:} %essid% ↑%upspeed% ↓%downspeed% %{A}
ramp-signal-font = 2
ramp-signal-0 =
ramp-signal-1 =
ramp-signal-2 =
ramp-signal-3 =
ramp-signal-4 =
ramp-signal-5 =
ramp-signal-padding = 1
ramp-signal-foreground = ${colors.foreground-alt}
; ramp-signal-background = ${colors.background-alt}
format-disconnected =
[module/eth]
type = internal/network
interface = net0
interval = 10.0
format-connected-underline = #55aa55
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.foreground-alt}
label-connected = %local_ip%
format-disconnected =
[module/battery]
type = internal/battery
battery = BAT0
adapter = AC
full-at = 98
format-charging = <animation-charging> <label-charging>
format-charging-underline = ${xrdb:color6:#ffb52a}
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${xrdb:color3:#ff9800}
format-full-prefix =
format-full-prefix-foreground = ${colors.foreground-alt}
format-full-underline = ${xrdb:color2:#719611}
; Only applies if <ramp-capacity> is used
ramp-capacity-0 =
ramp-capacity-1 =
ramp-capacity-2 =
ramp-capacity-3 =
ramp-capacity-4 =
; Only applies if <bar-capacity> is used
bar-capacity-width = 10
; Only applies if <animation-charging> is used
animation-charging-0 =
animation-charging-1 =
animation-charging-2 =
animation-charging-3 =
animation-charging-4 =
; Framerate in milliseconds
animation-charging-framerate = 750
[module/powermenu]
type = custom/menu
expand-right = true
format-spacing = 1
label-open = X
label-open-foreground = ${colors.secondary}
label-close = cancel
label-close-foreground = ${colors.secondary}
label-separator = |
label-separator-foreground = ${colors.foreground-alt}
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = reboot
menu-2-0 = power off
menu-2-0-exec = poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
; vim:ft=dosini
Comments
Post a Comment