home-manager icon indicating copy to clipboard operation
home-manager copied to clipboard

services.flameshot: requested by tray.target

Open teto opened this issue 2 years ago • 8 comments

Description

Note sure that's a proper fix, maybe it should remain in my own config but when I start sway, I never see the flameshot icon in tray until I systemctl --user restart flameshot. I haven't fully tested this yet but it seems to do the trick.

Checklist

  • [ ] Change is backwards compatible.

  • [ ] Code formatted with ./format.

  • [ ] Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • [ ] Test cases updated/added. See example.

  • [ ] Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • [ ] Added myself as module maintainer. See example.

Maintainer CC

teto avatar Oct 29 '23 16:10 teto

I think this might fix this flakey error that I've been facing over the last few months when restarting Home Manager

image

This error is probably also why OP can't see Flameshot on their tray until they restart the service.

GetPsyched avatar Oct 31 '23 09:10 GetPsyched

I've just rebooted and the icon was still hidden so that doesn't look enough as a fix

teto avatar Nov 01 '23 17:11 teto

Check any logs that you can find for it. If it doesn't show, there must be some error somewhere

GetPsyched avatar Nov 02 '23 07:11 GetPsyched

seems like it starts too early

Nov 04 21:51:32 jedha systemd[2606]: Started Flameshot screenshot tool.
Nov 04 21:51:33 jedha flameshot[2775]: QObject::connect: No such signal QPlatformNativeInterface::systemTrayWindowChanged(QScr>
Nov 04 22:38:55 jedha flameshot[2775]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"
Nov 04 22:39:00 jedha flameshot[2775]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/3”"

not sure what's the proper fix, maybe try restarts though not sure QObject::connect: No such signal makes the status as failed. Also a bit surprised to see networkmanager errors in flameshot logs :/

teto avatar Nov 05 '23 14:11 teto

Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.

If you are the original author of the PR

  • GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
  • If it is unfinished but you plan to finish it, please mark it as a draft.
  • If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
  • To get things rolling again, rebase the PR against the target branch and address valid comments.
If you are not the original author of the PR

  • If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.

stale[bot] avatar Feb 04 '24 16:02 stale[bot]

Hmm, are you using a status bar that includes

Unit.PartOf = [ "tray.target" ];
Install.WantedBy = [ "tray.target" ];

?

rycee avatar Feb 04 '24 22:02 rycee

My config: waybar works well but still flameshot will work only after systemctl --user restart flameshot.service.

➜ systemctl --user cat flameshot.service    
# /home/teto/.config/systemd/user/flameshot.service
[Install]
WantedBy=tray.target

[Service]
Environment=SDL_VIDEODRIVER=wayland
Environment=_JAVA_AWT_WM_NONREPARENTING=1
Environment=QT_QPA_PLATFORM=wayland
Environment=XDG_CURRENT_DESKTOP=sway
Environment=XDG_SESSION_DESKTOP=sway
Environment=PATH=/etc/profiles/per-user/teto/bin:/nix/store/lhif3s69vrawsr24nz33abkprkskx96q-grim-1.4.1/bin
ExecStart=/nix/store/l08ra7i3q7qsfh6llycvsd0p1whlm7v9-flameshot-12.1.0/bin/flameshot
LockPersonality=true
MemoryDenyWriteExecute=true
NoNewPrivileges=true
PrivateUsers=true
Restart=on-abort
RestrictNamespaces=true
SystemCallArchitectures=native
SystemCallFilter=@system-service

[Unit]
After=graphical-session-pre.target
After=tray.target
Description=Flameshot screenshot tool
PartOf=graphical-session.target
Requires=tray.target

# /home/teto/home/config/systemd/user/flameshot.service.d/override.conf
[Service]
Environment="QT_QPA_PLATFORM=wayland"
Environment="XDG_CURRENT_DESKTOP=sway"
~ via λ via 🌙 via 🐍 
➜ systemctl --user cat waybar.service   
# /home/teto/.config/systemd/user/waybar.service
[Install]
WantedBy=tray.target
WantedBy=graphical-session.target

[Service]
Environment=PATH=/nix/store/2am1jp8x76capbk3c1pazw7nlw9lrlyn-wlogout-1.2.1/bin:/nix/store/cg0im08qfvcvlq10vlq5frgq2hd2k47p-fuzzel-1.9.2/bin:/nix/store/fvy4bfl7bxpl990d9danqbjg7fi2yb37-wofi-1.4.1/bin:/etc/profiles/per-user/teto/bin
ExecReload=/nix/store/mb488rr560vq1xnl10hinnyfflcrd51n-coreutils-9.4/bin/kill -SIGUSR2 $MAINPID
ExecStart=/nix/store/iplj3g9izmr40m4wqxx6q9hzip8k2fcc-waybar-0.10.0/bin/waybar
KillMode=mixed
Restart=on-failure

[Unit]
After=graphical-session-pre.target
Description=Highly customizable Wayland bar for Sway and Wlroots based compositors.
Documentation=https://github.com/Alexays/Waybar/wiki
PartOf=tray.target
PartOf=graphical-session.target

I wonder if there ain't something happening with xdg portals as well, like flameshot should wait for xdg portals to be active before starting. Flameshot breaks also on multiscreen but I like the way I can edit the screenshot. Taking any recommendation for an alternative configurable in HM.

teto avatar Mar 19 '24 00:03 teto

Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.

If you are the original author of the PR

  • GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
  • If it is unfinished but you plan to finish it, please mark it as a draft.
  • If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
  • To get things rolling again, rebase the PR against the target branch and address valid comments.
If you are not the original author of the PR

  • If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.

stale[bot] avatar Jun 18 '24 05:06 stale[bot]