[GH-ISSUE #465] Duplicate icon in launcher #5776

Closed
opened 2026-05-23 01:52:57 +01:00 by JakeStanger · 9 comments
Owner

Originally created by @Ithvr on GitHub (Feb 20, 2024).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/465

Describe the bug
I get duplicate icon of some of my favorite applicastion in the launcher widget. I am unsure what the pattern is here since

To Reproduce
Steps to reproduce the behavior:

  1. Add application as favorites in launcher widget
  2. Start application
  3. See error

Expected behavior

For the applications to be "active" inside of the favorite icon

System information:

  • Distro: NixOS unstable
  • Compositor: Labwc 7.0
  • Ironbar version: 14.1

Configuration

Share your bar configuration and stylesheet as applicable:

Config
{
    "anchor_to_edges": true,
    "end": [
      {
        "type": "tray"
      },
      {
        "bar": [
          {
            "label": "",
            "name": "power-btn",
            "on_click": "popup:toggle",
            "type": "button"
          }
        ],
        "class": "power-menu",
        "popup": [
          {
            "orientation": "vertical",
            "type": "box",
            "widgets": [
              {
                "label": "Power menu",
                "name": "header",
                "type": "label"
              },
              {
                "type": "box",
                "widgets": [
                  {
                    "class": "power-btn",
                    "label": "<span font-size='40pt'></span>",
                    "on_click": "!shutdown now",
                    "type": "button"
                  },
                  {
                    "class": "power-btn",
                    "label": "<span font-size='40pt'></span>",
                    "on_click": "!reboot",
                    "type": "button"
                  }
                ]
              },
              {
                "label": "Uptime: {{30000:uptime -p | cut -d ' ' -f2-}}",
                "name": "uptime",
                "type": "label"
              }
            ]
          }
        ],
        "tooltip": "Up: {{30000:uptime -p | cut -d ' ' -f2-}}",
        "type": "custom"
      },
      {
        "type": "upower",
        "format": "{percentage}%"
      },
      {
        "type": "clock"
      }
    ],
    "icon_theme": "Tela-circle",
    "position": "bottom",
    "start": [
      {
        "favorites": [
          "firefox",
          "webcord",
          "steam",
          "codium",
          "element",
          "alacritty"
        ],
        "show_icons": true,
        "show_names": false,
        "type": "launcher"
      }
    ]
  }
Styles
@define-color color_bg #2d2d2d;
@define-color color_bg_dark #1c1c1c;
@define-color color_border #424242;
@define-color color_border_active #6699cc;
@define-color color_text #ffffff;
@define-color color_urgent #8f0a0a;

/* -- base styles -- */

* {
    font-family: Noto Sans Nerd Font, sans-serif;
    font-size: 16px;
    border: none;
    border-radius: 0;
}

box, menubar, button {
    background-color: @color_bg;
    background-image: none;
    box-shadow: none;
}

button, label {
    color: @color_text;
}

button:hover {
    background-color: @color_bg_dark;
}

scale trough {
    min-width: 1px;
    min-height: 2px;
}

#bar {
    border-top: 1px solid @color_border;
}

.popup {
    border: 1px solid @color_border;
    padding: 1em;
}


/* -- clipboard -- */

.clipboard {
    margin-left: 5px;
    font-size: 1.1em;
}

.popup-clipboard .item {
    padding-bottom: 0.3em;
    border-bottom: 1px solid @color_border;
}


/* -- clock -- */

.clock {
    font-weight: bold;
    margin-left: 5px;
}

.popup-clock .calendar-clock {
    color: @color_text;
    font-size: 2.5em;
    padding-bottom: 0.1em;
}

.popup-clock .calendar {
    background-color: @color_bg;
    color: @color_text;
}

.popup-clock .calendar .header {
    padding-top: 1em;
    border-top: 1px solid @color_border;
    font-size: 1.5em;
}

.popup-clock .calendar:selected {
    background-color: @color_border_active;
}


/* -- launcher -- */

.launcher .item {
    margin-right: 4px;
}

.launcher .ifix examtem:not(.focused):hover {
    background-color: @color_bg_dark;
}

.launcher .open {
    border-bottom: 1px solid @color_text;
}

.launcher .focused {
    border-bottom: 1px solid @color_border_active;
}

.launcher .urgent {
    border-bottom-color: @color_urgent;
}

.popup-launcher {
    padding: 0;
}

.popup-launcher .popup-item:not(:first-child) {
    border-top: 1px solid @color_border;
}


/* -- music -- */

.music:hover * {
    background-color: @color_bg_dark;
}

.popup-music .album-art {
    margin-right: 1em;
}

.popup-music .icon-box {
    margin-right: 0.4em;
}

.popup-music .title .icon, .popup-music .title .label {
    font-size: 1.7em;
}

.popup-music .controls *:disabled {
    color: @color_border;
}

.popup-music .volume .slider slider {
    border-radius: 100%;
}

.popup-music .volume .icon {
    margin-left: 4px;
}

.popup-music .progress .slider slider {
    border-radius: 100%;
}

/* -- script -- */

.script {
    padding-left: 10px;
}


/* -- sys_info -- */

.sysinfo {
    margin-left: 10px;
}

.sysinfo .item {
    margin-left: 5px;
}


/* -- tray -- */

/*.tray {
    margin-left: 10px;
}
*/

/* -- workspaces -- */

.workspaces .item.focused {
    box-shadow: inset 0 -3px;
    background-color: @color_bg_dark;
}

.workspaces .item:hover {
    box-shadow: inset 0 -3px;
}


/* -- custom: power menu -- */

.popup-power-menu #header {
    font-size: 1.4em;
    padding-bottom: 0.4em;
    margin-bottom: 0.6em;
    border-bottom: 1px solid @color_border;
}

.popup-power-menu .power-btn {
    border: 1px solid @color_border;
    padding: 0.6em 1em;
}

.popup-power-menu #buttons > *:nth-child(1) .power-btn {
    margin-right: 1em;
}

Additional context

Add any other context about the problem here.

Screenshots

If applicable, add screenshots to help explain your problem.
image

Originally created by @Ithvr on GitHub (Feb 20, 2024). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/465 **Describe the bug** I get duplicate icon of some of my favorite applicastion in the launcher widget. I am unsure what the pattern is here since **To Reproduce** Steps to reproduce the behavior: 1. Add application as favorites in launcher widget 2. Start application 3. See error **Expected behavior** > For the applications to be "active" inside of the favorite icon **System information:** - Distro: NixOS unstable - Compositor: Labwc 7.0 - Ironbar version: 14.1 **Configuration** > Share your bar configuration and stylesheet as applicable: <details><summary>Config</summary> ``` { "anchor_to_edges": true, "end": [ { "type": "tray" }, { "bar": [ { "label": "", "name": "power-btn", "on_click": "popup:toggle", "type": "button" } ], "class": "power-menu", "popup": [ { "orientation": "vertical", "type": "box", "widgets": [ { "label": "Power menu", "name": "header", "type": "label" }, { "type": "box", "widgets": [ { "class": "power-btn", "label": "<span font-size='40pt'></span>", "on_click": "!shutdown now", "type": "button" }, { "class": "power-btn", "label": "<span font-size='40pt'></span>", "on_click": "!reboot", "type": "button" } ] }, { "label": "Uptime: {{30000:uptime -p | cut -d ' ' -f2-}}", "name": "uptime", "type": "label" } ] } ], "tooltip": "Up: {{30000:uptime -p | cut -d ' ' -f2-}}", "type": "custom" }, { "type": "upower", "format": "{percentage}%" }, { "type": "clock" } ], "icon_theme": "Tela-circle", "position": "bottom", "start": [ { "favorites": [ "firefox", "webcord", "steam", "codium", "element", "alacritty" ], "show_icons": true, "show_names": false, "type": "launcher" } ] } ``` </details> <details><summary>Styles</summary> ``` @define-color color_bg #2d2d2d; @define-color color_bg_dark #1c1c1c; @define-color color_border #424242; @define-color color_border_active #6699cc; @define-color color_text #ffffff; @define-color color_urgent #8f0a0a; /* -- base styles -- */ * { font-family: Noto Sans Nerd Font, sans-serif; font-size: 16px; border: none; border-radius: 0; } box, menubar, button { background-color: @color_bg; background-image: none; box-shadow: none; } button, label { color: @color_text; } button:hover { background-color: @color_bg_dark; } scale trough { min-width: 1px; min-height: 2px; } #bar { border-top: 1px solid @color_border; } .popup { border: 1px solid @color_border; padding: 1em; } /* -- clipboard -- */ .clipboard { margin-left: 5px; font-size: 1.1em; } .popup-clipboard .item { padding-bottom: 0.3em; border-bottom: 1px solid @color_border; } /* -- clock -- */ .clock { font-weight: bold; margin-left: 5px; } .popup-clock .calendar-clock { color: @color_text; font-size: 2.5em; padding-bottom: 0.1em; } .popup-clock .calendar { background-color: @color_bg; color: @color_text; } .popup-clock .calendar .header { padding-top: 1em; border-top: 1px solid @color_border; font-size: 1.5em; } .popup-clock .calendar:selected { background-color: @color_border_active; } /* -- launcher -- */ .launcher .item { margin-right: 4px; } .launcher .ifix examtem:not(.focused):hover { background-color: @color_bg_dark; } .launcher .open { border-bottom: 1px solid @color_text; } .launcher .focused { border-bottom: 1px solid @color_border_active; } .launcher .urgent { border-bottom-color: @color_urgent; } .popup-launcher { padding: 0; } .popup-launcher .popup-item:not(:first-child) { border-top: 1px solid @color_border; } /* -- music -- */ .music:hover * { background-color: @color_bg_dark; } .popup-music .album-art { margin-right: 1em; } .popup-music .icon-box { margin-right: 0.4em; } .popup-music .title .icon, .popup-music .title .label { font-size: 1.7em; } .popup-music .controls *:disabled { color: @color_border; } .popup-music .volume .slider slider { border-radius: 100%; } .popup-music .volume .icon { margin-left: 4px; } .popup-music .progress .slider slider { border-radius: 100%; } /* -- script -- */ .script { padding-left: 10px; } /* -- sys_info -- */ .sysinfo { margin-left: 10px; } .sysinfo .item { margin-left: 5px; } /* -- tray -- */ /*.tray { margin-left: 10px; } */ /* -- workspaces -- */ .workspaces .item.focused { box-shadow: inset 0 -3px; background-color: @color_bg_dark; } .workspaces .item:hover { box-shadow: inset 0 -3px; } /* -- custom: power menu -- */ .popup-power-menu #header { font-size: 1.4em; padding-bottom: 0.4em; margin-bottom: 0.6em; border-bottom: 1px solid @color_border; } .popup-power-menu .power-btn { border: 1px solid @color_border; padding: 0.6em 1em; } .popup-power-menu #buttons > *:nth-child(1) .power-btn { margin-right: 1em; } ``` </details> **Additional context** > Add any other context about the problem here. **Screenshots** > If applicable, add screenshots to help explain your problem. ![image](https://github.com/JakeStanger/ironbar/assets/74909675/396f9236-619a-4ca8-b47c-0d2cbd785cb8)
JakeStanger 2026-05-23 01:52:57 +01:00
  • closed this issue
  • added the
    T:Bug
    label
Author
Owner

@JakeStanger commented on GitHub (Feb 24, 2024):

I think I know what's going on here, but I need some more info to confirm. Are you able to get a list of running clients out, and see what the window class & title for the duplicate actually is please?

I suspect that doesn't match the value in favorites so it doesn't know to group them.

<!-- gh-comment-id:1962658610 --> @JakeStanger commented on GitHub (Feb 24, 2024): I think I know what's going on here, but I need some more info to confirm. Are you able to get a list of running clients out, and see what the window class & title for the duplicate actually is please? I suspect that doesn't match the value in `favorites` so it doesn't know to group them.
Author
Owner

@Ithvr commented on GitHub (Feb 24, 2024):

I was actually able to fix it earlier today.
I had added "codium" in my favorite list, but when I run wlrctl toplevel list I saw that codium was named codium-url-handler.
When I put that line it then it grouped the icon properly. This seems to be case-sensitive since I had to change "alacritty" to "Alacritty".

<!-- gh-comment-id:1962673928 --> @Ithvr commented on GitHub (Feb 24, 2024): I was actually able to fix it earlier today. I had added "codium" in my favorite list, but when I run `wlrctl toplevel list` I saw that codium was named `codium-url-handler`. When I put that line it then it grouped the icon properly. This seems to be case-sensitive since I had to change "alacritty" to "Alacritty".
Author
Owner

@JakeStanger commented on GitHub (Feb 24, 2024):

You may well find that although that fixes the grouping, it breaks the ability to launch the program, unless xdg-open is smart enough to handle that?

<!-- gh-comment-id:1962677914 --> @JakeStanger commented on GitHub (Feb 24, 2024): You may well find that although that fixes the grouping, it breaks the ability to launch the program, unless `xdg-open` is smart enough to handle that?
Author
Owner

@Ithvr commented on GitHub (Feb 24, 2024):

From what I can see it seems to work well enough.
All of the icons I have in the launcher is able to start from clicking on the icon.
But while it works I do feel like this is a workaround more then a fix?

For reference this is what I have in my config currently

   "favorites": [
      "firefox",
      "WebCord",
      "steam",
      "codium-url-handler",
      "Element",
      "Alacritty"
    ],
<!-- gh-comment-id:1962687001 --> @Ithvr commented on GitHub (Feb 24, 2024): From what I can see it seems to work well enough. All of the icons I have in the launcher is able to start from clicking on the icon. But while it works I do feel like this is a workaround more then a fix? For reference this is what I have in my config currently ``` "favorites": [ "firefox", "WebCord", "steam", "codium-url-handler", "Element", "Alacritty" ], ```
Author
Owner

@JakeStanger commented on GitHub (Feb 25, 2024):

From what I can see it seems to work well enough.

Good to hear, thanks for confirming. Hopefully that saves me a bit of a headache.

But while it works I do feel like this is a workaround more then a fix?

Agreed, it's not obvious or ergonomic at the moment. The problem is some windows just don't have names that match their binaries, and it's not very obvious what you should use where without scouting through with your compositor's IPC. I'm open to ideas about how to improve it.

<!-- gh-comment-id:1963056357 --> @JakeStanger commented on GitHub (Feb 25, 2024): > From what I can see it seems to work well enough. Good to hear, thanks for confirming. Hopefully that saves me a bit of a headache. > But while it works I do feel like this is a workaround more then a fix? Agreed, it's not obvious or ergonomic at the moment. The problem is some windows just don't have names that match their binaries, and it's not very obvious what you should use where without scouting through with your compositor's IPC. I'm open to ideas about how to improve it.
Author
Owner

@Ithvr commented on GitHub (Feb 25, 2024):

I have limited knowledge on this, but when I saw trying to trouble shoot this I did see that (most) .desktop files has a StartupWMClass variable that might help: https://askubuntu.com/questions/367396/what-does-the-startupwmclass-field-of-a-desktop-file-represent

With that said I did see that not all of mine .desktop file had this variable. In this case it was steam and codium-url-handler .desktop files that did not have it.
Mind you I also see that codium have 2 .desktop files, one for codium and one for codium-url-handler.
I don't know if me using NixOS that effects this, but I guess I should put it out there.

<!-- gh-comment-id:1963063355 --> @Ithvr commented on GitHub (Feb 25, 2024): I have limited knowledge on this, but when I saw trying to trouble shoot this I did see that (most) .desktop files has a `StartupWMClass` variable that might help: https://askubuntu.com/questions/367396/what-does-the-startupwmclass-field-of-a-desktop-file-represent With that said I did see that not all of mine .desktop file had this variable. In this case it was steam and codium-url-handler .desktop files that did not have it. Mind you I also see that codium have 2 .desktop files, one for codium and one for codium-url-handler. I don't know if me using NixOS that effects this, but I guess I should put it out there.
Author
Owner

@JakeStanger commented on GitHub (Feb 27, 2024):

StartupWMClass is a legacy X11 concept, so it only gets applied to XWayland windows. I think it's also just a hint, and the window can set its class at some point later in the process anyway.

In the Wayland world, each window gets an app_id instead (so I end up having to look at both because XWayland isn't going away any time soon...).

It's not very clear whether Wayland abides by StartupWMClass at all, and I suspect it's on a per-application level. Still, that's an avenue worth exploring and might catch a few edge-cases, so I'll definitely look into it. Cheers for the pointer.

<!-- gh-comment-id:1967524605 --> @JakeStanger commented on GitHub (Feb 27, 2024): `StartupWMClass` is a legacy X11 concept, so it only gets applied to XWayland windows. I think it's also just a hint, and the window can set its class at some point later in the process anyway. In the Wayland world, each window gets an `app_id` instead (so I end up having to look at both because XWayland isn't going away any time soon...). It's not very clear whether Wayland abides by `StartupWMClass` at all, and I suspect it's on a per-application level. Still, that's an avenue worth exploring and might catch a few edge-cases, so I'll definitely look into it. Cheers for the pointer.
Author
Owner

@JakeStanger commented on GitHub (Mar 4, 2024):

As the original issue was resolved, I am going to close this. Future improvements will be tracked in the above issue for clarity.

If you have any further problems let me know and I can re-open, cheers.

<!-- gh-comment-id:1977635091 --> @JakeStanger commented on GitHub (Mar 4, 2024): As the original issue was resolved, I am going to close this. Future improvements will be tracked in the above issue for clarity. If you have any further problems let me know and I can re-open, cheers.
Author
Owner

@Ithvr commented on GitHub (Mar 5, 2024):

Make sense to centralize it to that issue.
My only opinion for how is that you might want to add a warning in the documentary that says that favorites is case sensitive, and that the window/appid might have a different starting name then expected.

<!-- gh-comment-id:1978099837 --> @Ithvr commented on GitHub (Mar 5, 2024): Make sense to centralize it to that issue. My only opinion for how is that you might want to add a warning in the documentary that says that favorites is case sensitive, and that the window/appid might have a different starting name then expected.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#5776
No description provided.