Questions tagged [xclip]

xclip is a command line interface to the X11 clipboard.

46 questions
3
votes
1 answer

Bash - change text copied to the clipboard using xclip

I am trying to convert text copied to the clipboard from something like this: +50.8863-114.0157/ to something like this: geo:50.8927777778,-114.013055556,0 I found this code on the Web: #!/bin/bash x="geo:"$(xclip -o | tr -d ' ') notify-send $x -i…
3
votes
2 answers

Why `xclip .bashrc` takes much longer than system("xclip .bashrc") in ruby?

irb(main):001:0> require 'benchmark' => true irb(main):002:0> puts Benchmark.measure { system "xclip .bashrc" } 0.000000 0.000000 0.000000 ( 0.008030) => nil irb(main):003:0> puts Benchmark.measure { `xclip .bashrc` } 0.000000 0.000000 …
toctan
  • 33
  • 1
  • 3
3
votes
0 answers

Subprocess.check_output or xclip -o hanging

On Linux mint I'm using the following code to monitor my clipboard: last_clip = '' try: while True: clip_contents = subprocess.check_output(['xclip', '-o']) if clip_contents != last_clip: #write clip_contents to file …
Wayne Werner
  • 49,299
  • 29
  • 200
  • 290
2
votes
1 answer

ubuntu 20.04 xclip targets has not image types

Currently I am not able to copy/paster images in gnome, especially for screenshots. When take a screenshot and save to clipboard using keyboard short cuts Ctrl+Alt+PrintScreen, an error message output in journal says "Failed to store clipboard:…
Gollum
  • 51
  • 5
2
votes
1 answer

Copy and paste svg image to libreoffice writer using xclip

I am used to use xclip to copy/paste png files into libreoffice writer. The command I use is: xclip -selection clipboard -t "image/png" -i Now, I want to copy/paste svg images, but I cannot figure out what is the appropriate "target"…
Carlos Galdino
  • 302
  • 3
  • 14
2
votes
1 answer

Accessing clipboard on Travis-CI

I am trying to run an (integration?) test on my application, to verify that it actually copies the expected string to the clipboard with pyperclip. This part is working on my development machine (Windows 10); but fails on travis-ci, where I get the…
JJC
  • 80
  • 2
  • 7
2
votes
2 answers

node child_process execSync hangs with xclip

I'm trying to use child_process to execute xclip -selection c, but it seems to hang or significantly delay execution. I've tried using execSync, require('child_process').execSync('echo hi | xclip -selection c') && console.log('done'); I've also…
junvar
  • 11,151
  • 2
  • 30
  • 46
2
votes
0 answers

xclip gtk copy file

While trying to copy files into the clipboard through bash, I ran into a bit of trouble. I'm currently using 'xclip -i -selection clipboard -t text/uri-list <<< $1' . The script works as expected in QT apps, but gtk doesn't seem to recognize the…
varikas
  • 21
  • 5
2
votes
2 answers

Git pre-push hook hangs after piping to xclip

Preamble: When committing I tend to format message as following: [] which should be converted by pre-push hook to a valid GitHub syntax as following: Work item [[](http://tracker/_workitems/)]: - [x]…
Eduard Sukharev
  • 1,188
  • 2
  • 15
  • 37
2
votes
1 answer

Why has xclip -loop 1 stopped working?

If I use e.g. echo 'test' | xclip -i -selection primary -loops 1 -quiet and paste into another terminal window, it works as expected, i.e. 'test' is pasted and then the primary selection goes back to the previous client, 'test' is gone. However,…
Stephan W.
  • 188
  • 13
1
vote
0 answers

cant change keyboard layout with xdotool

trying to get the current string written in the search bar in Firefox to be copied to my clipboard, than translating it like it was written in Hebrew keyboard layout, than pasting the translated string, and then changing keyboard…
1
vote
0 answers

Docker container - yank text using xclip

I am having issues related with xclip in a docker container. echo "text" | xclip which raises the error: Error: Can't open display: (null). How can I programmatically add some text to host's clipboard from the container (in an OS independent way if…
J. Snow
  • 305
  • 2
  • 10
1
vote
1 answer

How can I copy the contents of a file directly into my Windows clipboard when I'm running the command on a remote Linux machine via ssh in Git Bash?

I'm using Windows 10. I open Git Bash and then ssh into an Ubuntu server. Often I want to copy the whole contents of a large text file. Rather than using scp to download the file to my Windows machine, I sometimes would rather quickly copy the…
Ryan
  • 22,332
  • 31
  • 176
  • 357
1
vote
2 answers

Create a shortcut for a string that goes through a program

I have to, a lot of times, get things onto the clipboard from the terminal. I do it like this: echo "something"|xclip -selection clipboard Doing this every time is way too lame, and I want to make a shortcut. How do I do it?
1
vote
0 answers

How to run selected text using keyboard shortcut joined together with a command in background?

I am trying to be able to select text anywhere within my manjaro linux system and run it along with a TTS text to speech program. The program is called google_speech and it got a really clear default voice and is really easy to use, however I am…
Johnny5
  • 19
  • 2