gabm / Satty

Satty - Modern Screenshot Annotation. A tool inspired by Swappy and Flameshot.
Mozilla Public License 2.0
488 stars 22 forks source link

[Bug] clipboard cleared when satty closed #95

Closed Ciflire closed 2 months ago

Ciflire commented 2 months ago

Hi i'm having an issue where when i try to copy the image then close satty it clears my clipboard I can see it's been copied both with notification and cliphist

~ 
    nix-shell -p nix-info --run "nix-info -m"             
 - system: `"x86_64-linux"`
 - host os: `Linux 6.9.8, NixOS, 24.11 (Vicuna), 24.11.20240708.655a58a`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.4`
 - channels(root): `"nixos, nixpkgs"`
 - channels(ciflire): `""`
 - nixpkgs: `/nix/store/yzkx7gx2cn73dh3c7zg5rvgkp3yli1cd-source`

~ 
    satty --version
satty 0.13.0

it looks like it's related to this, seems like you did implement it but it doesn't work for me https://github.com/gabm/Satty/issues/26

If i can provide any information please tell.

gabm commented 2 months ago

if u can see it copied in cliphist, then everything that has to work on satty's did work (?)

what copy command are you using?

Ciflire commented 2 months ago

i'm using these commands

bind=$mod , print, exec, grimblast save area - | satty -f -
bind=$mod SHIFT, print, exec, grimblast save active screen - | satty -f -
Ciflire commented 2 months ago

also i can paste as long as satty is opened, something is happening when it closes, i don't know what tbh Also if it's not satty i don't know what it can be

gabm commented 2 months ago

then your clipboard Daemon doesn't properly read and store the clipboard?

Ciflire commented 2 months ago

i don't know how to check that tbh

gabm commented 2 months ago

Wayland does not "persist" the content of the clipboard in a way we might expect. instead, the content of it the clipboard is held by the application that "copied" it. Unfortunately - and by design of Wayland - that means that if the application offering the content shuts down, the content is "lost" and cannot be pasted anywhere.

To work around that behaviour, you can use tools like clipmon, clipman, cliphist and alike. Those tools copy the content once announced by the offering application and keep it around - sometimes forever in hard disk for you to choose from.

If you use such tool (cliphist in your case) and there you get a notification that satty has created content - i would expect that content to be available through cliphist.

Ciflire commented 2 months ago

Is is available, just inconvenient but I'll live. Thx for clarifying

gabm commented 2 months ago

alternatively you can use wl-copy as --copy-command wl-copy. It stays alive until some other process offers new content.

Note that cliphist might interfere here as after reading the content it will most likely offer it again to other applications

gabm commented 2 months ago

I don't think that anything can be done on satty's side.. if you think otherwise, pls re-open.