Re: Clipboard in gnome

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks everybody.  I just also picked up clipit and the install
was as routine as it gets.

	I'm noticing that Debian bullseye's security link that
one uses with apt seems to be broken right now for some reason.
It doesn't prevent one from updating or installing apps but as
someone who worked in network operations for a university for 25
years, you don't want the security framework to lag behind.  The
paranoids really are out there and they are out to get us.

Martin McCormick

Linux for blind general discussion <blinux-list@xxxxxxxxxx> writes:
> Tim here.  X offers two different clipboards by default: the
> "selection" buffer and the "clipboard", both of which should be
> independent of Gnome vs. KDE vs. whatever.
> 
> The "selection" buffer gets populated by selecting text (usually
> with the mouse, but also with the keyboard) and gets pasted using
> the middle-mouse button.
> 
> The "clipboard" is what most Windows/Mac folks would find familiar,
> cutting with control+x, copying with control+c, and pasting with
> control+v (and many applications have similar Cut/Copy/Paste commands
> in their respective Edit menus)
> 
> So using control plus X/C/V should work as expected across the vast
> majority of applications.
> 
> I run a program called "clipit" that sits in my system tray (I
> predominatly interact with it via keyboard shortcuts, almost never
> by clicking on it) that keeps a history of the last N clipboard
> contents, and can help synchronize the selection vs. clipboard
> contents.
> 
> Additionally, you can use programs like xclip or xsel to access the
> clipboard on the command-line similar to pbcopy/pbpaste on the Mac.
> So you can put a text file on the clipboard with
> 
>   $ xsel -ib < my_file.txt
> 
> or put the output of some command into the clipboard
> 
>   $ ps | xsel -ib
> 
> or grep the clipboard contents for some pattern:
> 
>   $ xsel -ob | grep "pattern"
> 
> You can even chain them so you can use sed to process your clipboard
> contents like
> 
>   $ xsel -ob | sed 's/old/new/g' | xsel -ib
> 
> Or use awk to sum the list of numbers in the clipboard, and append
> that sum to the clipboard contents:
> 
>   $ xsel -ob | awk '{t+=$1}END{print t}1' | xsel -ib
> 
> I have a shell function to strip out the utm_* tracking parameters
> from URLs that uses this trick:
> 
>   utm ()
>   {
>     xsel -ob | sed 's/&*\<utm_[^&]*//g;s/[&?]*$//' | xsel -ib
>   }
> 
> That lets me copy a URL to the clipboard, run "utm" and the URL in
> the clipboard has all the UTM tracking bits removed.
> 
> For context, the "-i" means that xsel should populate the clipboard
> (take it as *in*put) and the "-o" means that xsel should dump the
> contents of the clipboard on standard-out (provide *out*put).  The
> "b" option says to use the "clipboard" buffer rather than the
> "selection" buffer.
> 
> I don't use xclip as much, but it has similar options.
> 
> Hopefully this gives you some tools to make your life easier.
> 
> -tim

_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/blinux-list




[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]