Skip to content
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

Birdtray hard codes a default path #291745

Open
Syonis opened this issue Feb 27, 2024 · 18 comments
Open

Birdtray hard codes a default path #291745

Syonis opened this issue Feb 27, 2024 · 18 comments
Labels
0.kind: bug Something is broken

Comments

@Syonis
Copy link

Syonis commented Feb 27, 2024

Birdtray hard codes a default path

Steps to reproduce the behavior:

  1. nix-shell -p birdtray
  2. start birdtray

Expected behavior

If you leave it as it is Birdtray tries to start Thunderbird with "/usr/bin/thunderbird"
If you change that to "thunderbird" and launch birdtray it tries to launch "home/user/thunderbird"

Screenshots

birdtray_1 birdtray_2

Notify maintainers

@Flakebi

@Syonis Syonis added the 0.kind: bug Something is broken label Feb 27, 2024
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/birdtray-path-of-thunderbird/40319/3

@eclairevoyant
Copy link
Contributor

If you've added thunderbird to environment.systemPackages, then something like /run/current-system/sw/bin/thunderbird should work in the settings.

@Syonis
Copy link
Author

Syonis commented Feb 27, 2024

Jep, thx. that worked.
Should I than close this issue? Since the reason isn't fixed?

@AndrewKvalheim
Copy link
Contributor

Ideally the package should manage this e.g. via OPT_THUNDERBIRD_CMDLINE.

@eclairevoyant
Copy link
Contributor

eclairevoyant commented Feb 27, 2024

Ideally the package should manage this e.g. via OPT_THUNDERBIRD_CMDLINE.

That's only going to set the default, and will become wrong if the thunderbird storepath changes, because the config will not update even if the default does.

@AndrewKvalheim
Copy link
Contributor

I see, you’re pointing out that the default is copied to a stateful configuration file rather than merely used as a fallback.

@eclairevoyant
Copy link
Contributor

Yes, and the copying only happens if the config file doesn't already exist. I'm inclined to say that upstream should consider reading from PATH, or provide the capability to do so.

@dotlambda
Copy link
Member

Why don't we patch https://github.com/gyunaev/birdtray/blob/00110c50398cbae4d6da4521ccbf5d7166eac670/src/utils.cpp#L207? Replace the path with lib.getExe pkgs.thunderbird.

@eclairevoyant
Copy link
Contributor

eclairevoyant commented Feb 29, 2024

As said above, that will only affect the default path to thunderbird. That would break as soon as thunderbird updates and the config file points to a nonexistent binary.

If any patching were to be done, it would have to be done in src/settings.cpp, but that would break things for users who actually want to point to a binary elsewhere

@ddogfoodd
Copy link
Contributor

What if there was a fork of birdtray for nix users that don't want to customize the binary path and just let nix handle it? Wouldn't that work?

@Sikeen
Copy link

Sikeen commented May 26, 2024

what about a check for whether the system is nix or not? would that work?

@Sikeen
Copy link

Sikeen commented May 26, 2024

in this case, another if statement in the code

@eclairevoyant
Copy link
Contributor

eclairevoyant commented Jul 15, 2024

Now that upstream has made a fix, I've created a PR to pull in that commit. Please give the PR #327363 a test and let me know if it works as expected.

@eclairevoyant eclairevoyant removed the 9.needs: upstream fix This PR needs upstream to change something label Jul 15, 2024
@ddogfoodd
Copy link
Contributor

@eclairevoyant thanks! I am not sure, if it works for me. I can make birdtray start thunderbird and the birdtray log shows an unread message for an inbox as it should. However other than the log and startup, it doesn't seem connected. It shows a red cross as if it was not connected and doesn't show unread counter or quits thunderbird when is quit itself.

@eclairevoyant
Copy link
Contributor

Fair, I don't really use birdtray, so I don't know how it works, just made a best-effort attempt.
If it doesn't work as designed, I can close it out and leave it for someone else to work on.

@OscarCunningham
Copy link

OscarCunningham commented Dec 6, 2024

@ddogfoodd I just got birdtray working on NixOS myself. I had the issue in this thread, which I fixed by changing /usr/bin/thunderbird to /run/current-system/sw/bin/thunderbird in my birdtray settings. But I also had this issue gyunaev/birdtray#426 with an incompatibility between birdtray and wayland. I started birdtray with the WAYLAND_DISPLAY environment variable disabled, and it worked perfectly.

The reason I mention this is that it sounds like the fix above might actually have worked, but it still seems buggy to you because you're also experiencing the wayland bug.

Also tagging @eclairevoyant .

@eclairevoyant
Copy link
Contributor

Unsubscribing as I don't use birdtray.

@BlueDrink9
Copy link

How come it couldn't be patched just by setting OPT_THUNDERBIRD_CMDLINE=/run/current-system/sw/bin/thunderbird? Then it will still work across changes in Thunderbird binary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants