# optimise the png if optipng is installed. Mogrify -resize '>600x' "$TMP" || screenshotfail Gnome-screenshot -a -b -p -f "$TMP" || screenshotfail Use the -t option to specify the content type, like xclip -selection clipboard -t image/png -i example.png Share Improve this answer Follow answered at 20:00 Florian Diesch 85.2k 17 224 214 -t doesnt work on on my xclip version 0.12 Irfan at 5:59 Power-Inside: Works for me with xclip 0.12 on 16. Store text, HTML, images and any other custom format. Notify-send -u low -i image "Screenshot failed." CopyQ is clipboard manager with searchable and editable history. ![]() Here's my code in case anyone finds it useful: #!/bin/bash ![]() I got round this by converting it to text/html with a data url. The further problem I faced was that Thunderbird won't accept image/png from the clipboard. To copy a text file: copyq action 'cat /tmp/file.txt' '' & copyq select 0. Advanced command-line interface and scripting. It also allows you to put the contents of a file directly into the clipboard. It can also be used for copying files, as an alternative to sftp/scp, thus avoiding password prompts. It allows you to put the output of a command directly into the clipboard so that you don't have to copy&paste from the terminal manually (which can be a tedious task especially if the output is very long). xclip is a command line interface to the X11 clipboard. Install xclip (be sure the version is 0.12+svn84, because 0. Thanks to Florian's answer below I was able to achieve what I wanted, which was to take a screenshot and automatically scale it to a max of 600px wide (e.g. CopyQ is clipboard manager with searchable and editable history. xclip is a command line interface to the X11 clipboard. Is it possible to have an image on the clipboard without the application that generated it sitting around? - Sorry I'm not sure of the internals of how the clipboard works! EDIT ![]() I know of xclip, but AFAICS that only deals with text. Paste data from clipboard to file using Xclip Instead of displaying (pasting) the contents of clipboard, you can also directly paste the contents of the system clipboard or X11 primary selection area into a file like below: xclip -o -sel clip > outputfile.txt Or, xclip -o > outputfile. xclip is a nifty little utlity to make working in the terminal just a little more comfortable. Paste data from clipboard to file using Xclip Instead of displaying (pasting) the contents of clipboard, you can also directly paste the contents of the system clipboard or X11 primary selection area into a file like below: xclip -o -sel clip > outputfile.txt Or, xclip -o > outputfile.txt xclip -o > outputfile. The bit I'm stuck on is how to place an image on the clipboard. I'd like to write a script to take an image file, scale it 50% and put it on the clipboard so it can be pasted easily.
0 Comments
Leave a Reply. |