nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.19k stars 1.85k forks source link

bug: Syncthingtray started before tray #3416

Open budimanjojo opened 2 years ago

budimanjojo commented 2 years ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

Related ref: https://github.com/nix-community/home-manager/pull/2968

I can't get syncthingtray with either i3 or sway. It will work if I restart the service with systemctl --user restart syncthingtray after the system started. This is what I have in my home-manager config:

services.syncthing = {
  enable = true;
  tray.enable = true;
};

If I put services.syncthing.tray.command = "syncthingtray --wait", the tray icon will never show up too which is weird.

Screenshot from 2022-11-15 15-20-37

Maintainer CC

No response

System information

- system: `"x86_64-linux"`
- host os: `Linux 5.15.77, NixOS, 22.11 (Raccoon), 22.11.20221113.fc07622`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.11.0`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
exzombie commented 2 years ago

I bet this is related to #2878, can you confirm?

budimanjojo commented 2 years ago

@exzombie Thanks! I don't have theming issue. And I just tried installing pkgs.gnome-icon-theme and sadly the problem persists.

stale[bot] commented 1 year ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

liff commented 1 year ago

Not stale, I encountered the exact same problem.

liff commented 1 year ago

Related upstream issue: Alexays/Waybar#1090.

stale[bot] commented 1 year ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

brianmay commented 1 year ago

I have a kludge to fix this:

systemd.user.services.syncthingtray.Service.ExecStart = pkgs.lib.mkForce
    "${pkgs.bash}/bin/bash -c '${pkgs.coreutils}/bin/sleep 5; ${pkgs.syncthingtray-minimal}/bin/syncthingtray'";

I think this is a real issue that needs to be fixed, the problem is going to be getting consensus - particularly with upstream packages - on how to fix it.

stale[bot] commented 10 months ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

exzombie commented 10 months ago

If people are relying on kludges, it's not fixed yet.

I've recently played around a bit with HM+systemd tray handling. I don't use syncthing myself, so I can't test this service specifically. But looking at its user unit file, everything looks ok. Are you guys using a separate bar/tray application, or the one built into i3/sway? AFAICT, external tray applications will be started before tray.target and syncthingtray will be started after tray.target, so things should work. The problem is that the WM (and it's builtin bar) is started last, after all the systemd services. In that case, the only proper solution (apart from switching to a separate bar application) is to start your tray apps not as a systemd service, but from the WM.

Protarios commented 8 months ago

I have the same issue. I thought it might be related to using a quite old low power computer (Manjaro in Intel NUC 7i3BNH), as it works great on another installation of Manjaro on an up-to-date CPU.

--wait fixes the issue for me, but it seems to be kind of a dirty workaround.

TeChn4K commented 7 months ago

Not stale please

stale[bot] commented 4 months ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

brianmay commented 3 months ago

I tried a different hack. I set services.syncthing.tray.enable to false, then then set wayland.windowManager.sway.startup to [{ command = "${pkgs.syncthingtray-minimal}/bin/syncthingtray"; }]; (and similar for i3).

Unfortunately, it does not work, I get the error from swaythingtray that the tray hasn't started yet.

Which isn't really surprising, but thought I should mention it here.