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

won't preserve clipboard after copy source is closed #77

Closed
liaminventions opened this issue Jan 2, 2024 · 4 comments
Closed

won't preserve clipboard after copy source is closed #77

liaminventions opened this issue Jan 2, 2024 · 4 comments

Comments

@liaminventions
Copy link

cliphist won't preserve the clipboard after the copy source is closed unless the picker is run

for example, I copied text from Brave Browser, and then closed it, and tried to paste, and no data was pasted.
it works if I open the picker first though...

am I just launching it wrong or something or is this a new feature?

i launch it like this:

wl-paste --watch cliphist store
@sentriz
Copy link
Owner

sentriz commented Jan 2, 2024

that's just a feature of wayland i believe. you could try a project like wl-clip-persist to fix it. apparently it works alongside cliphist

@sentriz sentriz closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2024
@liaminventions
Copy link
Author

that's just a feature of wayland i believe. you could try a project like wl-clip-persist to fix it. apparently it works alongside cliphist

thanks! I added wl-clip-persist --clipboard both and it worked perfectly!

@liaminventions
Copy link
Author

quick update: I ended up using this command:

wl-clip-persist --clipboard regular --all-mime-type-regex '(?i)^(?!image/x-inkscape-svg).+'

from here: Linus789/wl-clip-persist#7

@Rabcor
Copy link

Rabcor commented Mar 26, 2024

I've had problems with wl-clip-persist too, so I just solved it by creating a script for clipboard persistence using cliphist

#!/bin/sh

previous="$(cliphist list | head -1 | awk '{$1=null; print $0}')"

cliphist store

current="$(cliphist list | head -1 | awk '{$1=null; print $0}')"

if [ "$current" != "$previous" ]; then
	cliphist list | head -1 | cliphist decode | wl-copy
fi

and I just invoke it like this (where cliphist-persist is the script name)
wl-paste --type text --watch cliphist-persist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants