From 885290d907ac49b4d6289b0e35daf01faedc698a Mon Sep 17 00:00:00 2001 From: Benjamin Voisin Date: Tue, 28 May 2024 21:02:07 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20improve=20waybar-menu=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- man/waybar-menu.5.scd | 62 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 10 deletions(-) diff --git a/man/waybar-menu.5.scd b/man/waybar-menu.5.scd index 10484e41..19790ed4 100644 --- a/man/waybar-menu.5.scd +++ b/man/waybar-menu.5.scd @@ -72,23 +72,65 @@ A module that implements a 'menu' needs 3 properties defined in its config : 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", - }, + "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 : +``` + + + + + + Suspend + + + + + Hibernate + + + + + Shutdown + + + + + + + + Reboot + + + + +``` + # STYLING MENUS - *menu*