Questions tagged [xclip]

xclip is a command line interface to the X11 clipboard. It can also be used for copying files, as an alternative to sftp/scp, thus avoiding password prompts when X11 forwarding has already been setup.

Filter by
Sorted by
Tagged with
1
vote
0answers
45 views

Copy large texts to clipboard in X11

If I try to copy a large file (around 30K) to clipboard with xsel (or xclip), the copy operation fails and the content of clipboard remains unchanged. If it's a hard limit in X11, is there any way to ...
0
votes
0answers
51 views

Display becomes unavailable for xclip

My setup is similar to this setup: Using xclip to copy to host clipboard from VM. Right after I ssh into the VM, everything works fine. I can copy at the server and paste in the host. After a ...
0
votes
1answer
34 views

How to use existing terminal session to save output with ANSI escape code like `script` or `screen -L` do?

I run a python script on konsole to print long logging for few hours, then I realized I want to save its output with color, but it's too late to run either script or screen -L to save the output as ...
2
votes
1answer
115 views

Xclip command works in shell but not in keyboard shortcut

I have to paste my email often during the day, and typing it is time consuming. That is why I am searching for a way to do this with a button press. The following command works to place my mail on my ...
2
votes
1answer
18 views

Pbcopy acts as Pbpaste when symlinked

To keep my configs sane between environments, I thought it's a great idea to do the following on MacOS. ln -s /usr/bin/pbcopy /usr/local/bin/xclip However, my xclip symlink does not act just as ...
0
votes
0answers
257 views

How to replace CTRL+C shortcut with same action plus xclip save copied selection command?

I am trying to be able to save/log all clipboard selection copies to a clipboard_histroy.log file. I want this to be able to simply append each copied selection to the log file but at the same time ...
0
votes
2answers
97 views

How to grab x characters long of start text from xclip selection and append to filename?

So I am trying to figure out how to add a title after the timestamp in my xclip script here. I would like it to grab about 24 characters worth of text from the beginning of each selection and save it ...
1
vote
1answer
71 views

How to get clipboard as input file name to Vim on bash?

I install xclip to access system clipboard, my setting and some operations as below: ➜ ~ cat .zshrc | grep xclip alias c="xclip -selection c" alias v="xclip -selection c -o" ➜ ~ which dict | c ➜ ~ ...
1
vote
0answers
74 views

xclip copy file so it can be pasted as a file (not file content) [duplicate]

How can I copy a file with xclip, so that it is pastable as a file in file explorers? I searched on google an so on and found stuff like this Copy file to xclip and paste to Firefox, but there it is ...
3
votes
0answers
214 views

How can I paste a gif from the clipboard with xclip?

I'm trying to copy a gif into my clipboard such that I would be able to paste it into web applications (slack, github, etc.). I have tried the following without any luck: xclip -selection clipboard -...
0
votes
2answers
89 views

xclip doesn’t send contents to netcat

I got an assignment from my teacher to try and beat a bot which sends a number each time and I need to send the exact number, but faster. I wrote a bash script: #!/bin/bash while true; do nc ip ...
0
votes
0answers
86 views

Global filter on clipboard?

I'd like to make kind of filter for clipboard to remove newline characters at the end from anything I copy-paste on a daily basis. I know I could set a daemon listening through xclip for changes and ...
1
vote
0answers
132 views

Piping to another program in the middle of a oneliner

I'm trying to create a simple bash one line script that allows me to pick a particular barcode that's visible on my screen and make it available as text on my clipboard. To that effect, I wrote a bash ...
0
votes
2answers
171 views

How to chain external commands in VIM?

If I select the following text in a VIM buffer in VISUAL mode f() { echo "f"; } f and then execute :'<,'>w !xclip | !eval "$(xclip -o)" I get /bin/bash: eval: line 3: syntax error ...
1
vote
0answers
6k views

xclip Outputs “Error: Can't open display: (null)”

I recently installed xclip on my CentOS 7 server. Since my machine does not have an X server, I'd have to configure my machine to forward X11 to my client. Following the steps explained in this ...
0
votes
1answer
299 views

Tmux run-shell xclip not working

I am using tmux 2.3 and want to define a command to send the paste-buffer to system clipboard. I have tried using the command below and every variant I can think of, but when I try to run it, I get a ...
6
votes
1answer
291 views

Why does xclip-copied text pasted into Gmail on Firefox turn line breaks into spaces?

I have a text editor I made that uses xclip to copy text. I notice that when I paste the xclip-copied text (pasting the regular way, with ctrl+v) into a Gmail email on Firefox 54.0 (64-bit) that I'm ...
4
votes
1answer
1k views

xclip image binary contents pasted into text fields

Say I pick some png file and run the following command: xclip -selection clip -t image/png image.png I now have that image in my clipboard. If I paste it somewhere that accepts an image, it is ...
1
vote
1answer
3k views

Copy file to clipboard from console

I'm trying to copy the actual file content, including the file header and binary contents of a file to the clipboard. The file is a .pdf in this case. I've come across multiple solutions, but they ...
10
votes
1answer
5k views

How to copy text from command line to clipboard without using the mouse?

I'm trying to figure out a way to copy the current text in a command line to the clipboard WITHOUT touching the mouse. In other words, I need to select the text with the keyboard only. I found a half-...
8
votes
0answers
687 views

xsel and xclip hang

My objective is to make a text on my remote machine (CentOS 7.2) available to seamlessly paste on my local machine (OS X 10.12.2) with the standard ⌘V shortcut. My setup connects to the remote ...
1
vote
1answer
1k views

TMUX 2.3 copy to clipboard

I am using TMUX 2.3 just recently copying stopped working. Here is the relevant section that lets me copy stuff to the clipboard: bind-key -t vi-copy 'v' begin-selection bind-key -t vi-copy y copy-...
4
votes
2answers
2k views

xclip works differently in interactive and non-interactive shells

While investigating a problem described in a question at stackoverflow I simplified it down to a test case demonstrating that in non-interactive mode bash seems to clear the X system clipboard before ...
1
vote
0answers
51 views

Using xclip as workaround for missing key on keyboard?

My q key is gone from my keyboard. I'm trying to assign ctrl-a as a way to enter my q's, so from the bash prompt echo "q" |xclip; xclip -o outputs a q.. but saving that to a script then ...
0
votes
0answers
502 views

Is the default selection of xclip the primary one?

In the manpage of xclip -selection specify which X selection to use, options are "primary" to use XA_PRIMARY (default), "secondary" for XA_SECONDARY or "clipboard" for XA_CLIPBOARD Since the ...
-2
votes
1answer
933 views

Do xsel and xclip work only for copy and not for paste?

The usages of xsel and xclip seem to me all about the copy operation, whether it is primary or clipboard selection. When I perform the paste operation, is it only by using mouse or trackpad, not via ...
4
votes
1answer
137 views

Abbreviated long options on the command line of xclip

In the manpage of xclip -selection specify which X selection to use, options are "primary" to use XA_PRIMARY (default), "secondary" for XA_SECONDARY or "clipboard" for XA_CLIPBOARD Note that ...
10
votes
1answer
521 views

Is it possible to know the source (application) of the clipboard?

I've noticed that sometimes clipboard contents become unavailable if the source application (where the content was copied from) is closed. This leads me to wonder if it's possible to know what the ...
2
votes
1answer
297 views

Is there a way to replace the currently selected text on X11?

I stumbled across xclip which gives you access to the text you have selected on your active window. I've been thinking if there was a way to alter such text. The workflow I have in mind is the ...
53
votes
7answers
50k views

Use system clipboard in vi-copy mode in tmux

I'm running tmux 1.6 and I'm trying to configure it to use vi-style keybindings as well as use the system clipboard when copying in interactive mode: set-window-option -g mode-keys vi bind-key -t vi-...
4
votes
1answer
3k views

xclip does not change the clipboard content

I'm trying to give the following command: echo "hi" | xclip -selection c This doesn't work? It has worked in the past, but never consistently. I also tried echo "hi" | xclip -selection primary ...
7
votes
1answer
2k views

Copy markdown input to the clipboard as rich text

I'm about to get involved in some collaborative prose writing with a friend of mine via email. As a regular person, he will of course be using MS Word document formats; as a massive nerd, I prefer to ...
8
votes
6answers
6k views

tmux xclip copy no longer working

On mu Ubuntu 12.04 setups my tmux clipboard copy and paste commands are setup as follows: set -g prefix M-a unbind C-b bind C-c run "tmux save-buffer - | xclip -i -sel clipboard" bind C-v run "tmux ...
10
votes
2answers
3k views

How to target multiple selections with xclip

When copying text to the clipboard, xclip provides several selection targets: -selection specify which X selection to use, options are: "primary" to use XA_PRIMARY (default), "secondary"...
119
votes
17answers
99k views

Getting tmux to copy a buffer to the clipboard

I am trying to figure out a decent way to copy what I have in a tmux buffer into my clipboard. I have tried a couple of different things like bind-key p select-pane -t 2 \; split-window 'xsel -i -b'...