Skip to main content

Questions tagged [xclip]

Use this tag for questions about using the xclip utility to copy text into and from the X clipboard.

Filter by
Sorted by
Tagged with
1 vote
1 answer
282 views

Bash: programmatically output text to cursor?

I'm trying to cook up a script to use OpenAI's Whisper as a speech-to-text. The basic idea is I press some key combination, it starts recording to an audio file somewhere, I stop it, it analyzes the ...
Gridzbi Spudvetch's user avatar
0 votes
0 answers
108 views

.desktop that copies clicked urls to clipboard in place of a default browser

I would like to create a simple .desktop file that I can use in place of a default browser that simply copies any clicked url to the clipboard and displays a short confirming message. I have written ...
Immy's user avatar
  • 1
0 votes
1 answer
333 views

Work around for "xclip -o -selection clipboard -t text/html" -> "Error: target text/html not available"

In gnome-terminal, xclip -o -selection clipboard -t text/html gives Error: target text/html not available In some sense, this makes sense, because gnome-terminal does not accept html pastes. However,...
bjohas's user avatar
  • 523
0 votes
1 answer
712 views

script that uses xclip not working from keyboard shortcut

Output of uname -a: Linux negosaki 5.11.0-46-lowlatency #51~20.04.1-Ubuntu SMP PREEMPT Fri Jan 7 08:04:34 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux I have the following script in ~/bin/flameshot-ocr, ...
Christoffer Corfield Aakre's user avatar
0 votes
1 answer
299 views

How to save a QR code generated from the Electrum Wallet directly as a PNG or JPG file?

How do I save and send the QR code: as a jpg or png? There are ways to use gimp and/or xclip but I would hope that I can just save the QR code directly to file. Is this possible? Notably, Windows ...
Nicholas Saunders's user avatar
0 votes
1 answer
623 views

How can I insert an image into the clipboard using a terminal or bash script?

I'm making a custom script that uses ImageMagick to take screenshots because I deleted the original application and wanted to do a custom one. #! /bin/sh. cd magickScreenshots/ ls -v | cat -n | while ...
i deleted system32 help's user avatar
2 votes
0 answers
535 views

How to set up a systemd service to listen on a socket and copy the contents to the clipboard?

I am trying to follow this tutorial which will help me copy text from remote tmux sessions onto my local clipboard. The first there is to setup a systemd service which listens on a given port on the ...
shahensha's user avatar
  • 153
1 vote
1 answer
2k views

enabling copy/ paste on ubuntu-server 18.04.4

How can I use xclip to create a shared clipboard experience? I require to have a shared clipboard with a iDRAC Dell server running ubuntu-server 18.04.4. The install is a minimal install without ...
dcyph3r's user avatar
  • 43
1 vote
0 answers
443 views

xclip not working when invoked from keyboard shortcut

I got the command: echo "[email protected]"| tr -d '\n' | xclip -selection c It works when I run it from the terminal. However, when I added it as custom keyboard shortcut nothing happens. ...
Krzysztof's user avatar
  • 131
17 votes
1 answer
8k views

Detect clipboard copy/paste event and modify clipboard contents

After something is copied to clipboard (using ctrl+c) I want a script (bash, python or any other language) to automatically detect that new entry is added to clipboard, change it's content and put it ...
SidMan's user avatar
  • 401
1 vote
1 answer
2k views

Is it possible to copy a variable to the Shift+Insert clipboard from the command line?

When I create scripts, I use the xclip command to copy a variable to the clipboard, so I can paste it using CTRL+V or automate my script to paste it with xdotool. The command that I use to copy a ...
Rafael Muynarsk's user avatar
18 votes
4 answers
18k views

Alternative to xsel or xclip *without* X11 installed?

xclip/xsel need X11. When I use putty from a Windows box to linux (without X11 installed), is there an alternative to xsel or xclip? I would like to pipe the complete shell command output to the ...
I grok it's user avatar
  • 191
0 votes
1 answer
322 views

How do I make a keyboard shortcut for code which uses xsel?

OS: Kubuntu 18.04 or Ubuntu 18.04 I want to remove the first seven characters of certain strings I copy. For example, I want to first copy and then convert 1234567890 to 890 I can do so with the ...
DK Bose's user avatar
  • 43.5k
1 vote
1 answer
2k views

Copying a SSH public key on a VPS with a SSH connection [duplicate]

I am trying to copy my public key on a VPS. After I connect I run the following xclip -sel clip < ~/.ssh/id_rsa.pub Xclip gives me a can't open display error. Right now I manually open the ...
burnedfaceless's user avatar
4 votes
1 answer
547 views

Launching mpv from a .desktop entry with the clipboard as argument

I'm trying to make a submenu entry on a .desktop application file that launches a youtube address with mpv. The youtube url is copied from the clipboard. Inside gnome-terminal this works fine: xclip -...
B Jog's user avatar
  • 43
1 vote
0 answers
378 views

xclip on remote machine [duplicate]

I want to paste the contents of my clipboard on machine A (client - Windows 7), to machine B (Ubuntu 16.04 Server). I followed the instructions here, but I'm still having the same problem. Here is the ...
Ali's user avatar
  • 11
2 votes
1 answer
3k views

How does clipboard work? [duplicate]

On a deep level, how does copying something to the clipboard work? Is there a file that stores the text or image I copy somewhere? I found Memory location of clipboard where the question was never ...
Kaia's user avatar
  • 123
1 vote
1 answer
1k views

How can I feed clipboard content to gnome-terminal?

I have a plugin that generates and copies to the clipboard a ready-to-paste command. For now I open a new terminal, paste the command and execute it. I want to write a script that automatically opens ...
MonkeyBack's user avatar
3 votes
2 answers
1k views

Odd behavior of xclip

The xclip manual says that there are three storage locations named primary (XA_PRIMARY), secondary (XA_SECONDARY) and clipboard (XA_CLIPBOARD). I copied (Ctrl+c) some text from my browser and examined ...
user avatar
2 votes
1 answer
724 views

Change character encoding in a text file

Is there a way to change the character encoding of a text file? If so, how? See, I am using a keyboard shortcut to call a shell command which itself uses xclip to copy the contents of a file into ...
Juan Antonio's user avatar
  • 1,582
2 votes
1 answer
6k views

Sending content to the clipboard via a Bash script

If I do echo foo | xclip -i in the terminal and then Ctrl + V, I get foo. But instead, if I write a file, bar.sh #!/bin/sh echo bar | xclip -i and run ./bar.sh in the terminal, the clipboard content ...
Faccion's user avatar
  • 23
2 votes
1 answer
4k views

Copy to clipboard from command line [duplicate]

Trying to copy to clipboard from command line by using command: xclip /etc/apt/sources.list Trying to get out from clipboard: xclip -o This prints the content of sources.list and it is fine. But ...
vico's user avatar
  • 4,637
98 votes
7 answers
54k views

'xclip' vs. 'xsel'

There are two command-line tools (in two different packages) to access the X clipboard: xclip xsel I would love to know the difference between those two and hear a recommendation which one to use in ...
Byte Commander's user avatar
  • 109k
3 votes
1 answer
2k views

Add a newline at end of clipboard contents

I use xclip to copy the contents of the clipboard and pipe them to another application. However, if the last line that was copied doesn't have an end of line character, it doesn't show in the ...
Ananda Mahto's user avatar
1 vote
1 answer
273 views

Open chrome with content of clipboard

Lets say I have a URL in my clipboard, if I run on the terminal: xclip -o It will echo the domain, I would like to use this content as a variable to put on the command: google-chrome --enable-...
Mauricio Vargas's user avatar
0 votes
1 answer
906 views

Use xclip in a launcher command on xfce4 panel?

I'm trying to get this command line to work in a launcher on xfce4: echo "myAdress" | xclip -selection clipboard If i use this command line in the standard terminal, there are no problems. Executed ...
TuKsn's user avatar
  • 4,400
0 votes
1 answer
230 views

How to add a Package to kernel to make it default package?

I want to add xclip package to kernel to make it default package. Means if I give mine custom version of kernel to someone to install then xclip package should also be installed with kernel. They don'...
NitinKabra's user avatar
9 votes
2 answers
5k views

Processing clipboard text through a script in between copy and paste

I want to intercept the paste event and run any text through my script. The use case is like this (assume I have a script somewhere which accepts text on stdin and turns 'world' into 'potato', ...
wim's user avatar
  • 12.9k
64 votes
2 answers
31k views

unable to paste with xclip outside of terminal

I am trying to copy from the terminal with xclip and paste it into the unity desktop environment into gedit text editor. I can copy and paste with xclip in terminal: $ cat line-size.c | xclip xclip -...
JohnMerlino's user avatar
  • 7,529