[GH-ISSUE #222] [Launcher] Incorrect programs being opened #97

Closed
opened 2026-05-22 21:51:12 +01:00 by JakeStanger · 7 comments
Owner

Originally created by @donovanglover on GitHub (Jul 4, 2023).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/222

Describe the bug
Launcher does not open the correct programs. For example, thunar opens the bulk renamer.

To Reproduce

  1. Add thunar to launcher
  2. Open thunar

Expected behavior
File browser is opened.

System information:

Additional context

Originally created by @donovanglover on GitHub (Jul 4, 2023). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/222 **Describe the bug** Launcher does not open the correct programs. For example, `thunar` opens the bulk renamer. **To Reproduce** 1. Add `thunar` to launcher 2. Open `thunar` **Expected behavior** File browser is opened. **System information:** - Distro: NixOS - Compositor: Hyprland - Ironbar version: https://github.com/JakeStanger/ironbar/commit/f8d8c063008340922b20aa665d8f893ab63e82d7 **Additional context** - https://github.com/nwg-piotr/nwg-dock-hyprland/issues/5
JakeStanger 2026-05-22 21:51:12 +01:00
  • closed this issue
  • added the
    T:Bug
    label
Author
Owner

@JakeStanger commented on GitHub (Jul 5, 2023):

Hey are you able to confirm how both programs were installed, and if possible the absolute path to their desktop files please?

The opening process works by finding the desktop file and passing that to gtk-launch. There have been some recent changes to the code that finds the file so that might be a culprit.

<!-- gh-comment-id:1621832037 --> @JakeStanger commented on GitHub (Jul 5, 2023): Hey are you able to confirm how both programs were installed, and if possible the absolute path to their desktop files please? The opening process works by finding the desktop file and passing that to gtk-launch. There have been some recent changes to the code that finds the file so that might be a culprit.
Author
Owner

@donovanglover commented on GitHub (Jul 5, 2023):

Thunar and the bulk renamer are both called with thunar, so their paths are the same. Thunar was installed the usual way and you are free to reproduce my setup in NixOS.

$ whereis thunar
thunar: /nix/store/0rjs5mmfgzkvbarc5q4rpcn4488na206-system-path/bin/thunar

I also encountered issues with org.qutebrowser.qutebrowser opening zathura, although surprisingly it works as expected now. Looks like it doesn't work anymore.

qutebrowser also works, however it opens a separate icon (or uses org.qutebrowser.qutebrowser) instead of using the existing one.

I feel like this is related to the change used to fix github.com/nwg-piotr/nwg-dock-hyprland@5128931d1b, although I haven't digged in ./src/modules/launcher yet.

<!-- gh-comment-id:1621926880 --> @donovanglover commented on GitHub (Jul 5, 2023): Thunar and the bulk renamer are both called with `thunar`, so their paths are the same. Thunar was installed [the usual way](https://github.com/donovanglover/nix-config/blob/781c28f4ed56cfe2aa6da78d825314ef9b85978a/modules/thunar.nix#L2) and you are free to reproduce my setup in NixOS. ``` $ whereis thunar thunar: /nix/store/0rjs5mmfgzkvbarc5q4rpcn4488na206-system-path/bin/thunar ``` I also encountered issues with `org.qutebrowser.qutebrowser` opening `zathura`, ~~although surprisingly it works as expected now.~~ Looks like it doesn't work anymore. `qutebrowser` also works, however it opens a separate icon (or uses `org.qutebrowser.qutebrowser`) instead of using the existing one. I feel like this is related to the change used to fix https://github.com/nwg-piotr/nwg-dock-hyprland/commit/5128931d1b59573b638d525ac7a41b9f65467905, although I haven't digged in `./src/modules/launcher` yet.
Author
Owner

@yavko commented on GitHub (Jul 5, 2023):

Thunar and the bulk renamer are both called with thunar, so their paths are the same. Thunar was installed the usual way and you are free to reproduce my setup in NixOS.

Yeah but what are the desktop file locations

<!-- gh-comment-id:1622048594 --> @yavko commented on GitHub (Jul 5, 2023): > Thunar and the bulk renamer are both called with `thunar`, so their paths are the same. Thunar was installed [the usual way](https://github.com/donovanglover/nix-config/blob/781c28f4ed56cfe2aa6da78d825314ef9b85978a/modules/thunar.nix#L2) and you are free to reproduce my setup in NixOS. > Yeah but what are the desktop file locations
Author
Owner

@donovanglover commented on GitHub (Jul 5, 2023):

Looks like home manager packages are in /etc/profiles/per-user/user/share/applications and system packages are in /run/current-system/sw/share/applications/. Both are in XDG_DATA_DIRS.

Thunar has different .desktop files for the bulk renamer and the usual file browser.

  • /run/current-system/sw/share/applications/thunar.desktop
  • /run/current-system/sw/share/applications/thunar-bulk-rename.desktop
<!-- gh-comment-id:1622093011 --> @donovanglover commented on GitHub (Jul 5, 2023): Looks like home manager packages are in `/etc/profiles/per-user/user/share/applications` and system packages are in `/run/current-system/sw/share/applications/`. Both are in `XDG_DATA_DIRS`. Thunar has different `.desktop` files for the bulk renamer and the usual file browser. - `/run/current-system/sw/share/applications/thunar.desktop` - `/run/current-system/sw/share/applications/thunar-bulk-rename.desktop`
Author
Owner

@yavko commented on GitHub (Jul 5, 2023):

Looks like home manager packages are in /etc/profiles/per-user/user/share/applications and system packages are in /run/current-system/sw/share/applications/. Both are in XDG_DATA_DIRS.

Thunar has different .desktop files for the bulk renamer and the usual file browser.

  • /run/current-system/sw/share/applications/thunar.desktop
  • /run/current-system/sw/share/applications/thunar-bulk-rename.desktop

So I think I found it, in this code it's checking if any field "contains" it, so obviously it's going to be positive for thunar-bulk-renaner, I mean it includes thunar. But I'm not sure idk much about this code.
https://github.com/JakeStanger/ironbar/blob/master/src/desktop_file.rs#L110-L115

<!-- gh-comment-id:1622298476 --> @yavko commented on GitHub (Jul 5, 2023): > Looks like home manager packages are in `/etc/profiles/per-user/user/share/applications` and system packages are in `/run/current-system/sw/share/applications/`. Both are in `XDG_DATA_DIRS`. > > Thunar has different `.desktop` files for the bulk renamer and the usual file browser. > > - `/run/current-system/sw/share/applications/thunar.desktop` > - `/run/current-system/sw/share/applications/thunar-bulk-rename.desktop` So I *think* I found it, in this code it's checking if any field "contains" it, so obviously it's going to be positive for `thunar-bulk-renaner`, I mean it includes thunar. But I'm not sure idk much about this code. https://github.com/JakeStanger/ironbar/blob/master/src/desktop_file.rs#L110-L115
Author
Owner

@JakeStanger commented on GitHub (Jul 5, 2023):

Ah yeah I think you're correct. The fix should just be to do a first pass that checks for an exact match, then do the contains in a second pass

<!-- gh-comment-id:1622413957 --> @JakeStanger commented on GitHub (Jul 5, 2023): Ah yeah I think you're correct. The fix should just be to do a first pass that checks for an exact match, then do the `contains` in a second pass
Author
Owner

@JakeStanger commented on GitHub (Jul 5, 2023):

Turns out it was actually incorrectly matching on the file name before reading any of the desktop files.

I've tested the above with thunar and thunar-bulk-rename and both now seem to be working reliably. It also shimmies the logic around a bit to try and prevent the same thing happening in other places.

If you're able to, could you give it ago yourself and let me know if it does the trick or you encounter any other false matches please?

<!-- gh-comment-id:1622620996 --> @JakeStanger commented on GitHub (Jul 5, 2023): Turns out it was actually incorrectly matching on the file name before reading any of the desktop files. I've tested the above with `thunar` and `thunar-bulk-rename` and both now seem to be working reliably. It also shimmies the logic around a bit to try and prevent the same thing happening in other places. If you're able to, could you give it ago yourself and let me know if it does the trick or you encounter any other false matches please?
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#97
No description provided.