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...")
 
 
(4 intermediate revisions by the same user not shown)
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.


= Documentation =
<blockquote>
{| class="wikitable"
|-
| github || https://github.com/astrand/xclip
|-
| <code>man xclip</code> || https://man.archlinux.org/man/extra/xclip/xclip.1.en
|}
</blockquote><!-- Documentation -->
= Usage =
<blockquote>
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo echo "#!/bin/bash
# copy 'foo' to selection-buffer (shift+ins)
xclip -selection c -f
echo foo | xclip
" > /usr/bin/clip
 
# copy 'foo' to clipboard (ctrl+v, alt+shift+ins)
echo foo | xclip -selection clipboard 


sudo chmod 755 /usr/bin/clip
# print contents of secondary clipboard
xclip -o -selection secondary
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Usage -->

Latest revision as of 01:14, 5 February 2024

xclip is a cli interface for your clipboard.

Documentation

github https://github.com/astrand/xclip
man xclip https://man.archlinux.org/man/extra/xclip/xclip.1.en

Usage

# copy 'foo' to selection-buffer (shift+ins)
echo foo | xclip

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

# print contents of secondary clipboard
xclip -o -selection secondary