sentriz / cliphist

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

Paste item directly after select #111

Closed bingo084 closed 2 months ago

bingo084 commented 2 months ago

I use command below as picker.

cliphist list | rofi -dmenu | cliphist decode | wl-copy

After select an item, I have to use ctrl-v paste it again, is there anyway paste item directly after select?

I tried command below but not working.

cliphist list | rofi -dmenu | cliphist decode | wl-copy && wl-paste
wide4 commented 2 months ago

cliphist list | rofi -dmenu | cliphist decode | wl-copy && wtype $(wl-paste)

be sure to install wtype

bingo084 commented 2 months ago

cliphist list | rofi -dmenu | cliphist decode | wl-copy && wtype $(wl-paste)

be sure to install wtype

Thanks, but I found that this only works for text, not images.

I simulated the shortcut key for paste.

cliphist list | rofi -dmenu | cliphist decode | wl-copy && wtype -M ctrl -k v -m ctrl
sentriz commented 2 months ago

thanks for the help @diagonalized

can this be closed now @bingo084 ?

mberrueta commented 1 week ago

this more or less works, but the problem is that if you have a character like -S it fail wtype and nothing is pasted.

try pacman -S xdg-desktop-portal-hyprland for example

I solved with

cliphist list | wofi -dmenu | cliphist decode | wl-copy && wl-paste --no-newline | xargs -I {} wtype {}

sentriz commented 1 week ago

if you have a character like -S it fail wtype and nothing is pasted

you probably need a -- to discern flags from arguments. eg wtype -- -S will type -S