sentriz / cliphist

wayland clipboard manager with support for multimedia
GNU General Public License v3.0
719 stars 22 forks source link

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

Closed liaminventions closed 10 months ago

liaminventions commented 10 months ago

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 commented 10 months ago

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

liaminventions commented 10 months ago

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 commented 10 months ago

quick update: I ended up using this command:

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

from here: https://github.com/Linus789/wl-clip-persist/issues/7

Rabcor commented 7 months ago

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