Xclip: Difference between revisions

From wikinotes
(Created page with "For the most part xclip is already configured - however I do not like the default behaviour (does not copy to clipboard) so I wrote my own little bash script in order to have...")
 
No edit summary
Line 1: Line 1:
For the most part xclip is already configured - however I do not like the default behaviour (does not copy to clipboard) so I wrote my own little bash script in order to have different flags set by default. now instead of using <nowiki>ls |  xclip -selection c -f</nowiki> simply use <nowiki> ls | clip </nowiki>
xclip is a cli interface for your clipboard.


= Usage =
<blockquote>
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo echo "#!/bin/bash
echo foo | xclip                      # copy 'foo' to selection-buffer (shift+ins)
xclip -selection c -f
echo foo | xclip -selection clipboard  # copy 'foo' to clipboard        (ctrl+v, alt+shift+ins)
" > /usr/bin/clip
 
sudo chmod 755 /usr/bin/clip
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Usage -->

Revision as of 23:00, 6 August 2021

xclip is a cli interface for your clipboard.

Usage

echo foo | xclip                       # copy 'foo' to selection-buffer (shift+ins)
echo foo | xclip -selection clipboard  # copy 'foo' to clipboard        (ctrl+v, alt+shift+ins)