Closed pwndumb closed 3 years ago
By default, xclip
copies to X primary selection, XA_PRIMARY
which is not where most apps expect to find clipboard data. To copy to the clipboard, XA_CLIPBOARD
, with Ctrl-Y, use `--bind 'ctrl-y:execute-silent(echo {+} | xclip -se c)'.
By default,
xclip
copies to X primary selection,XA_PRIMARY
which is not where most apps expect to find clipboard data. To copy to the clipboard,XA_CLIPBOARD
, with Ctrl-Y, use `--bind 'ctrl-y:execute-silent(echo {+} | xclip -se c)'.
i tried this method but it`s not working my Q is how to copy text from terminal ? i am using ctrl shift space for marking text Thank you so much @rogerdahl
@Sy3Omda That's a different question altogether and depends on your terminal emulator and which keyboard shortcuts it has. Have you tried right-clicking the marked text?
I used this:
# Use like normal fzf, but the output are copied to the clipboard
f()
{
# https://stackoverflow.com/a/46726373/9157799
if [ -p /dev/stdin ] # if data was piped
then
stdin=$(</dev/stdin)
echo "$stdin" | fzf "$@" | xclip
fzo="$(xclip -o)"
else
fzo=$(fzf "$@")
fi
if [ "$fzo" != "" ]
then
echo -n "$fzo" | xclip -se c
echo "$fzo"
fi
}
You can use it like an alias of fzf e.g. cat list | f
@imambungo Thx for this tip but i mean here to high-lite desired text in terminal (terminator) and with key binding copy it or just ctrl + shift + c
to copy it, all this by using only keyboard not mouse.
@Sy3Omda I don't know how to do that in terminator but you can use tmux to do that.
I tried several options and these worked out for me. This might help someone looking for these.
--bind 'ctrl-y:execute(readlink -f {} | xclip -selection clipboard)'
--bind 'ctrl-alt-y:execute-silent(xclip -selection clipboard {})'
Just adding here; Thank for all this !
w/ zsh --
This is working for me with xclip -- --bind 'ctrl-y:execute(readlink -f {} | echo -n {2..} | xclip -selection clipboard)'
man fzf
)Info
Problem / Steps to reproduce
I cant copy select line in fzf to my clipboard. I Just try a lot of combinations but not work. The default key CTRL+R never work. . I use this option