xsel - utility for pasting files to clipboard

Miscellaneous tools
Post Reply
Message
Author
jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

xsel - utility for pasting files to clipboard

#1 Post by jpeps »

Paste files to clipboard:

xsel < file (paste with middle button of mouse)

or:

xsel -b <file (paste with cont-v)

check xsel -h for other options

download:

http://jpeters.net/apps/xsel-0.9.6-i486.pet

http://jpeters.net/apps/xsel-0.9.6-i486.pet.md5.txt

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#2 Post by BarryK »

Note also that Puppy 4.00 has 'xclip' -- type 'man xclip' in a terminal for help.
[url]https://bkhome.org/news/[/url]

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#3 Post by jpeps »

BarryK wrote:Note also that Puppy 4.00 has 'xclip' -- type 'man xclip' in a terminal for help.
Thanks Barry; I didn't know about xclip. From what I can see, both do about the same things...perhaps xsel takes a little less typing:

xsel -b == xclip -o -sel clip
xsel == xclip -o

I just realized that you can pipe to them...which is nice for sending output from scripts right to the clipboard:

passfile selection | xsel (or xclip)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#4 Post by musher0 »

Hello all.

Please wait a full minute for the dust on this 10-year old thread to
dissipate -- so you can read the rest of this post!!! :lol:

~~~~~~~~

Here is a handy trick you can use if your old opera-12.16 browser (or any
old browser that you like) will not show a page (it jams on it or takes
forever to show it).

Edit your defaultbrowser script at /usr/local/bin like so:

Code: Select all

#!/bin/sh
# defaultbrowser
####
BlocNote="`xsel -o`"
if [ "${BlocNote:0:4}" = "http" ];then
     exec palemoon $BlocNote 2>/dev/null
else
     exec palemoon "$@" 2>/dev/null
fi
If you are using "defaultbrowser" directly, it does not change a thing.

But if there is an URL in the clipboard, your defaut browser will load it
automatically.

Coming back to our scenario, your browser is being fussy? The solution
is frustration-free: copy the contents of its address bar (Ctrl-A then
Ctrl-C), and run your default browser.

You can adapt this trick to other browsers (e.g. SeaMonkey or Vivaldi).
Something like:

Code: Select all

#!/bin/sh
# seamonkey.sh
####
cd /mnt/home/seamonkey-2.49.2
BlocNote="`xsel -o`"
if [ "${BlocNote:0:4}" = "http" ];then
     exec /mnt/home/seamonkey-2.49.2/seamonkey $BlocNote
else
     exec /mnt/home/seamonkey-2.49.2/seamonkey "$@"
fi
(The problem is that you cannot run a browser from another browser
anymore, and this mini-script basically solves it.)

Enjoy.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Post Reply