waybar-menu(5)

πŸ’– waybar-menu β€” the menu property, but make it group chat πŸ’–

hii bestie 🫢 you just opened waybar-menu(5) from the File Formats Manual, and honestly it's a whole vibe: it's the page all about the menu property in waybar. It's short, it's sweet, and by the end you're gonna be popping menus like a main character πŸ‘‘


🌸 OVERVIEW 🌸

okay so listen ✨ some modules support a menu, which is literally the thing that lets you have a popup menu when a defined click is done over the module. that's it. that's the whole premise. cute right? πŸŽ€


✨ PROPERTIES ✨

so a module that implements a menu needs 3 properties defined in its config. three. that's the whole checklist πŸ’…

  • typeof: string

Action that popups the menu. The possibles actions are:

  • on-click β€” when you left-click on the module πŸ–±οΈ
  • on-click-release β€” when you release left button on the module
  • on-double-click β€” when you double left click on the module
  • on-triple-click β€” when you triple left click on the module
  • on-click-middle β€” when you middle click on the module using mousewheel
  • on-click-middle-release β€” when you release mousewheel button on the module
  • on-double-click-middle β€” when you double middle click on the module
  • on-triple-click-middle β€” when you triple middle click on the module
  • on-click-right β€” when you right click on the module using
  • on-click-right-release β€” when you release right button on the module
  • on-double-click-right β€” when you double right click on the module
  • on-triple-click-right β€” when you triple middle click on the module
  • on-click-backward β€” when you click on the module using mouse backward button
  • on-click-backward-release β€” when you release mouse backward button on the module
  • on-double-click-backward β€” when you double click on the module using mouse backward button
  • on-triple-click-backward β€” when you triple click on the module using mouse backward button
  • on-click-forward β€” when you click on the module using mouse forward button
  • on-click-forward-release β€” when you release mouse forward button on the module
  • on-double-click-forward β€” when you double click on the module using mouse forward button
  • on-triple-click-forward β€” when you triple click on the module using mouse forward button
ngl that's a lot of click flavors. left, middle, right, backward, forward β€” single, double, triple, and the whole *-release family too. pick your fighter πŸ₯Š
  • typeof: string

Location of the menu descriptor file. There need to be an element of type GtkMenu with id menu. πŸ™ˆ

  • 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. (iykyk β€” if the ids don't match up, nothing links, and you'll be sitting there like πŸ’€)


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". Each 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="hibernate">
                    <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>

okay a whole power menu, no cap πŸ”₯ shutdown, reboot, suspend, hibernate, plus a lil GtkSeparatorMenuItem divider to keep it organized. periodt.


πŸŽ€ 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;
}

slay πŸ’… rounded corners on everything, #161320 background, #B5E8E0 text β€” it's giving cozy little floating bubble 🫧


and that's the whole page bestie!! 🌈 that was waybar-menu(5) from the File Formats Manual, dated 2026-02-08 β€” go forth and pop your menus, you absolute icon πŸ‘‘πŸ’–βœ¨

πŸ“¦ where this page comes from