Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 18 Apr 2015, 04:58
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Copy any selection to clipboard
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [29 Posts]   Goto page: 1, 2 Next
Author Message
MochiMoppel


Joined: 26 Jan 2011
Posts: 644
Location: Japan

PostPosted: Sun 27 Jul 2014, 10:17    Post subject:  Copy any selection to clipboard
Subject description: Sending primary selection (e.g. in console) to clipboard
 

Edit 2013-4-13: I changed the thread title (was: Terminal emulator (urxvt etc.): Copy selection to clipboard) to reflect the fact that my proposal is not restricted to the use in a console. I also added an alternative method which makes copying easier.
---------------------------

Users switching from MS Windows to Linux take it for granted that the keyboard shortcut Ctrl+C will put selected text into the clipboard. Big surprise when in a terminal window like urxvt this doesn't apply anymore.

Experienced users know that Linux holds every selection in a "primary" buffer and that in any application this buffer can be pasted with the middle mouse button or - now it's getting complicated - in a console window also with Shift+Insert.

Still there are many situations where copying terminal text to the clipboard would be useful. The lack of a middle mouse button is only one of them.

Here are 2 simple ways to create a "Copy to Clipboard" shortcut (Ctrl+Shift+C) :

Method 1: Keyboard shortcut with JWM
Step 1: Edit the file /root/.jwm/jwmrc-personal. Add 1 line:
<Key mask="CS" key="c">exec:xclip -o|xclip -sel clip</Key>
Step 2: Restart JWM

Method 2: Keyboard shortcut/desktop icon with ROX
see this post

Text copied with Ctrl+Shift+C can then be pasted into other applications with the familiar Ctrl+V.

That's it....well, almost:
Above shortcut uses the tool xclip, which is included in all Puppy versions I tested. However even newest Puppy versions use the old xclip version 0.08 (typing xclip -version into a terminal window reveals the version). This version does not support UTF-8 characters and users of languages with funny characters like French, German or Japanese might get pasted ASCII salad instead. See here
As mentioned in the link a new version can be obtained at http://slackware.org.uk/slacky/slackware-14.0/utilities/xclip/0.12/

Download xclip-0.12-i486-2sl.txz , extract the file /usr/bin/xclip (all the other stuff is not important) and copy it to /usr/bin. This will not overwrite the old version which - for obscure reasons - resides in usr/X11R7/bin. When calling xclip Puppy will first look into /usr/bin, will find the new version and will not bother to look any further. Tested in Slacko, Precise and Lupu.

.

Last edited by MochiMoppel on Mon 13 Apr 2015, 03:08; edited 1 time in total
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 3006
Location: New Zealand

PostPosted: Thu 02 Apr 2015, 04:44    Post subject:  

Just wanted to say thanks for this mod - I have been using it for quite a while now and it makes every day so much better!
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6496
Location: Auckland, New Zealand

PostPosted: Thu 02 Apr 2015, 05:10    Post subject:  

Quote:
Experienced users know that Linux holds every selection in a "primary" buffer and that in any application this buffer can be pasted with the middle mouse button or - now it's getting complicated - in a console window also with Shift+Insert.

FWIW there are simple patches to fix gtk 2 and 3 to add this feature.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 644
Location: Japan

PostPosted: Thu 02 Apr 2015, 07:28    Post subject:  

greengeek wrote:
I have been using it for quite a while now and it makes every day so much better!
Thanks - now we are two Laughing
disciple wrote:
FWIW there are simple patches to fix gtk 2 and 3 to add this feature.
Fix what? Add which feature?
Back to top
View user's profile Send private message 
Jasper


Joined: 25 Apr 2010
Posts: 1267
Location: England

PostPosted: Thu 02 Apr 2015, 07:56    Post subject:  

Hi MochiMoppel,

I dare say, at least three. Thank you.

My regards
Back to top
View user's profile Send private message 
mavrothal


Joined: 24 Aug 2009
Posts: 2218

PostPosted: Thu 02 Apr 2015, 10:42    Post subject:  

Nice.
If you use xsel instead of xclip and combine it with xdotool you can also paste. Wink

_________________
Kids all over the world go around with an XO laptop. They deserve one puppy (or many) too Very Happy
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11351
Location: Arizona USA

PostPosted: Thu 02 Apr 2015, 11:21    Post subject:  

Highlighting text I want to copy, then simultaneously clicking the left and right mouse buttons to paste it, has worked for me in every version of Puppy I've used. Am I the only one this works for?
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 5133
Location: Gatineau (Qc), Canada

PostPosted: Thu 02 Apr 2015, 12:06    Post subject:  

disciple wrote:
Quote:
Experienced users know that Linux holds every selection in a "primary" buffer and that in any application this buffer can be pasted with the middle mouse button or - now it's getting complicated - in a console window also with Shift+Insert.

FWIW there are simple patches to fix gtk 2 and 3 to add this feature.


Hello, disciple.

Stating your sources or a how-to would be most useful!
Thanks in advance. BFN.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 5133
Location: Gatineau (Qc), Canada

PostPosted: Thu 02 Apr 2015, 12:07    Post subject:  

mavrothal wrote:
Nice.
If you use xsel instead of xclip and combine it with xdotool you can also paste. Wink


Thanks for the reference.

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
mavrothal


Joined: 24 Aug 2009
Posts: 2218

PostPosted: Thu 02 Apr 2015, 12:23    Post subject:  

Flash wrote:
Highlighting text I want to copy, then simultaneously clicking the left and right mouse buttons to paste it, has worked for me in every version of Puppy I've used. Am I the only one this works for?

Works for everybody, but middle click will paste at the mouse cursor point, Ctrl-shift-V at the text cursor point Wink

_________________
Kids all over the world go around with an XO laptop. They deserve one puppy (or many) too Very Happy
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 5133
Location: Gatineau (Qc), Canada

PostPosted: Thu 02 Apr 2015, 13:03    Post subject:  

mavrothal wrote:
Flash wrote:
Highlighting text I want to copy, then simultaneously clicking the left and right mouse buttons to paste it, has worked for me in every version of Puppy I've used. Am I the only one this works for?

Works for everybody, but middle click will paste at the mouse cursor point, Ctrl-shift-V at the text cursor point Wink


Now the man tells us! Wink

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
greengeek

Joined: 20 Jul 2010
Posts: 3006
Location: New Zealand

PostPosted: Thu 02 Apr 2015, 14:06    Post subject:  

Fantastic!! Mavrothal's link suggested using Shift+Insert as a method to paste into the terminal. Seems to work for me! I previously had to use left and right click simultaneously for the 'paste' function. So now I can use that technique for paste and Mochis mod for copy.

I would be even happier if there was some way to set up "Shift+Ctrl+V" for the paste. Now that I have got used to Mochi's mod it seems so natural for me that adding "Shift" to Ctrl+c lets me copy from terminal, so I'd like to just add "Shift" to Ctrl+v for the paste into terminal.

EDIT : Faceslap !!! Now I see Mochi mentioned Shift+insert in the first post. I can be soooo stoopid. All these months there was an easier way...
Embarassed
.
ps: I'd still love to see shift+insert replaced by Shift+Ctrl+v
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 10176

PostPosted: Thu 02 Apr 2015, 14:30    Post subject:  

yep just noticed the shift insert which for me makes life much easier... especially with some laptops/netbook interfaces... I wonder what we will find out thats been hidden in the next 9 years Very Happy

xbinkeys or xmodmap or something might be useful... but to be honest a mouse free method is a big bonus..no more triple pastes Smile

mike
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6496
Location: Auckland, New Zealand

PostPosted: Thu 02 Apr 2015, 18:32    Post subject:  

MochiMoppel wrote:
greengeek wrote:
I have been using it for quite a while now and it makes every day so much better!
Thanks - now we are two Laughing
disciple wrote:
FWIW there are simple patches to fix gtk 2 and 3 to add this feature.
Fix what?

GTK ignoring the standard behaviour in X to paste the Primary Selection with Shift-Insert.
Quote:
Add which feature?

That one.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6496
Location: Auckland, New Zealand

PostPosted: Thu 02 Apr 2015, 18:40    Post subject:  

musher0 wrote:
disciple wrote:
Quote:
Experienced users know that Linux holds every selection in a "primary" buffer and that in any application this buffer can be pasted with the middle mouse button or - now it's getting complicated - in a console window also with Shift+Insert.

FWIW there are simple patches to fix gtk 2 and 3 to add this feature.


Hello, disciple.

Stating your sources or a how-to would be most useful!
Thanks in advance. BFN.

musher0

http://murga-linux.com/puppy/viewtopic.php?t=80150

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [29 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1024s ][ Queries: 12 (0.0052s) ][ GZIP on ]