Man page - waybar-menu(5)
Packages contains this manual
- waybar-backlight-slider(5)
- waybar-river-layout(5)
- waybar-sway-scratchpad(5)
- waybar-pulseaudio-slider(5)
- waybar-hyprland-submap(5)
- waybar-river-mode(5)
- waybar-keyboard-state(5)
- waybar-cffi(5)
- waybar-pulseaudio(5)
- waybar-states(5)
- waybar-clock(5)
- waybar(5)
- waybar-dwl-tags(5)
- waybar-niri-window(5)
- waybar-niri-workspaces(5)
- waybar-dwl-window(5)
- waybar-sndio(5)
- waybar-niri-language(5)
- waybar-hyprland-language(5)
- waybar-wireplumber(5)
- waybar-mpris(5)
- waybar-gamemode(5)
- waybar-sway-language(5)
- waybar-hyprland-workspaces(5)
- waybar-power-profiles-daemon(5)
- waybar-battery(5)
- waybar-wlr-taskbar(5)
- waybar-tray(5)
- waybar-menu(5)
- waybar-sway-workspaces(5)
- waybar-styles(5)
- waybar-sway-mode(5)
- waybar-cpu(5)
- waybar-river-window(5)
- waybar-mpd(5)
- waybar-hyprland-window(5)
- waybar-sway-window(5)
- waybar-network(5)
- waybar-systemd-failed-units(5)
- waybar-jack(5)
- waybar-temperature(5)
- waybar-river-tags(5)
- waybar-custom(5)
- waybar-idle-inhibitor(5)
- waybar-bluetooth(5)
- waybar-privacy(5)
- waybar-backlight(5)
- waybar-inhibitor(5)
- waybar-image(5)
- waybar-upower(5)
- waybar-disk(5)
- waybar-memory(5)
apt-get install waybar
Manual
waybar-menu
NAMEOVERVIEW
PROPERTIES
MENU-FILE
EXAMPLE
STYLING MENUS
EXAMPLE:
NAME
waybar - menu property
OVERVIEW
Some modules support a ’menu’, which allows to have a popup menu whan a defined click is done over the module.
PROPERTIES
A module that implements a ’menu’ needs 3 properties defined in its config :
menu :
|
typeof: string |
||
|
Action that popups the menu. The possibles actions are : |
menu-file :
|
typeof: string |
||
|
Location of the menu descriptor file. There need to be an element of type |
GtkMenu with id menu .
menu-actions :
|
typeof: array |
|
|
The actions corresponding to the buttons of the menu. The identifiers of |
each actions needs to exists as an id in the ’menu-file’ for it to be linked properly.
MENU-FILE
The menu-file is an ‘.xml‘ file representing a GtkBuilder. Documentation for it can be found here : https://docs.gtk.org/gtk4/class.Builder.html
Here, it needs to have an element of type GtkMenu with id "menu". Eeach actions in menu-actions are linked to elements in the menu-file file by the id of the elements.
EXAMPLE
Module config :
"custom/power": {
|
"format" : "⏻ ", |
||||
|
"tooltip": false, |
||||
|
"menu": "on-click", |
||||
|
"menu-file": "˜/.config/waybar/power_menu.xml", |
||||
|
"menu-actions": { |
||||
|
"shutdown": "shutdown", |
||||
|
"reboot": "reboot", |
||||
|
"suspend": "systemctl suspend", |
||||
|
"hibernate": "systemctl hibernate", |
||||
|
}, |
},
˜/.config/waybar/power_menu.xml :
<?xml
version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkMenu"
id="menu">
|
<child> |
||||
|
<object class="GtkMenuItem" id="suspend"> |
||||
|
<property name="label">Suspend</property> |
</object>
|
</child> |
|
|
<child> |
<object class="GtkMenuItem" id="hibernat">
|
<property name="label">Hibernate</property> |
</object>
|
</child> |
<child>
<object class="GtkMenuItem"
id="shutdown">
|
<property name="label">Shutdown</property> |
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem"
id="delimiter1"/>
</child>
<child>
|
<object class="GtkMenuItem" id="reboot"> |
||||
|
<property name="label">Reboot</property> |
||||
|
</object> |
</child>
</object>
</interface>
STYLING MENUS
|
• |
menu Style for the menu |
|||
|
• |
menuitem Style for items in the menu |
EXAMPLE:
menu {
|
border-radius: 15px; |
|
|
background: #161320; |
|
|
color: #B5E8E0; |
}
menuitem {
|
border-radius: 15px; |
}