Custom menu popups and workspaces icons bug. Application window-rewrite icons spawn after the application is killed and stay in the bar forever.
OS: Arch Linux x86_64 Hyprland Kernel: Linux 6.17.7-arch1-1 waybar 0.14.0-4
I've started using custom menu popups on my waybar recently and I noticed that they work glitchy. When you click on an element that has "menu": "on-click", "menu-file": "custom-menu.xml" and that particular menu option executes an application the "hyprland/workspaces" module will not render the icon of that application when it's active, but it WILL render an icon AFTER the application is killed.
This causes stuff like this:
Basically several application icons appearing AFTER they're closed and not alive anymore with no way of clearing those icons without completely killing waybar and activating it again.
To replicate. Make sure to create a standard custom popup menu as described in the wiki:
config.jsonc:
"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>
But, instead of standard:
"menu-actions": {
"shutdown": "shutdown",
"reboot": "reboot",
"suspend": "systemctl suspend",
"hibernate": "systemctl hibernate",
},
Have something that activates ANY application, for example evolution mail client, or anything you use, really:
"menu-actions": {
"shutdown": "evolution",
"reboot": "kitty",
},
Observe how the icons do not appear in the workspaces module, and appear only after they're killed... Maybe it's constrained only to hyprland/worspaces module and it's window-rewrite section, but it might be the case in every other tiling window manager, this needs to be checked, I don't use anything else apart from that.
Hmmm, while investigating what is really going on, I found that if you execute an app via hyprctl dispatch exec then it will fix the problem with icons not appearing in the workspace window. It might be a communication error between waybar and Hyprland, I guess. So far, I'm using hyprctl dispatch exec before any .sh or application names in my config and it fixes the problem for now and it's only the case for using custom menu popups, not using hyprctl dispatch exec in any other module is absolutely fine.