-
-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding the ability to have dropdown menu for modules #3247
Conversation
You can configure what key launch the menu with the "menu" element in the config, the xml file that describes the menu with the "menu-file" element in the config, and the actions of each buttons with the "menu-actions" field.
Hey guys, wouldn't it be possible to use the already existing groups? But just adding orientation = popout-vertical | popout-horizontal | popout-inherit or something. Thanks for your effort guys! |
@nevaforget My implementation uses Gtk objects in a more general way. That is why their is a |
Can you add it to the man, as well as an example to the default conf? :) |
When the menu cannot be built (file not existing, or wrongly formatted), the menu is not created and a warning with an explanaition is displayed.
@Alexays I've added the checks asked, and I made sure that the app doesn't crash when trying to build the popup menu. If something fails during constructions, it display a warning message explaining why, and still launch the waybar. I've also updated the manpages of all the modules supporting this behaviour, and created a dedicated |
This would be so so so so useful to have. |
Thanks! |
Thanks to new feature in Alexays/Waybar#3247
I'm using the code you provided, but the GtkSeparatorMenuItem seem to not show up, there's just no spacing between items at all like it's ignored completely, what am I doing wrong? |
@user880907 Does the example I provided above work ? It has a GtkSeparatorMenuItem and it shows up correctly. You may add padding into the |
@benjamin-voisin It looks like this. |
Also, is it possible to color the icon (preferably not the text)? |
the same thing is happening to me |
Scratch that. The functionality also depends on statically declared menu actions in the module definition so I don't suppose this would be an available option. In this case it is indeed better to have a full-fledged rofi instance. |
Related to #1064 : Every ALabel module now can have a dropdown menu that can be spawned using any click you want. The menu is defined with a
xml
file, and the comportment of each button can be configured in the waybar/conf file. The menus can by styled in thewaybar/style.css
.For example, you can now easily built a well-integrated power module with this config:
Where the
~/.config/waybar/power_menu.xml
look like this:This gives something like this:
And it can by styled with some css:
To look like this :
The GObject is in the AModule class, so every module could have such menu, but I figured that only the ALabel class should build it automatically reading the config. For other AModule, it could be made differently.