-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
base: master
Are you sure you want to change the base?
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 |
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.