LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 11-26-2009, 10:45 PM   #1
Chriswaterguy
Member
 
Registered: Apr 2007
Distribution: CrunchBang 10 Statler
Posts: 106

Rep: Reputation: 16
paste commonly used chunks of text?


I want to easily paste commonly used selections of text. I regularly edit wiki pages, and send emails with similar core text, so this would be handy. Something light and quick with a simple hotkey popup would be ideal.

I've heard of such things, but can't find one now - lacking the right search terms I think (insert commonly used text didn't work, even in http://www.google.com/linux).

Any suggestions?
 
Old 11-26-2009, 10:52 PM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,049

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
I am not sure if this is what you need. But you can give it a try.

Parcellite is a clipboard manager that can be used for many things, but amongst its many features it has a history that can be accessed with the keyboard, using control+alt+h. You can run parcellite (it will live in your system tray if you have one), then select the many text fragments in any arbitrary order, and then just use the history menu to select whatever you can to paste at a given time. Then just paste as usual.
 
Old 11-27-2009, 01:09 AM   #3
Chriswaterguy
Member
 
Registered: Apr 2007
Distribution: CrunchBang 10 Statler
Posts: 106

Original Poster
Rep: Reputation: 16
An adapted Parcellite might do it

Thanks, i92guboj.

Quote:
Originally Posted by i92guboj View Post
Parcellite is a clipboard manager that can be used for many things, but amongst its many features it has a history that can be accessed with the keyboard, using control+alt+h. You can run parcellite (it will live in your system tray if you have one), then select the many text fragments in any arbitrary order, and then just use the history menu to select whatever you can to paste at a given time. Then just paste as usual.
Actually I already use Parcellite and it's great (but I didn't know about the keyboard shortcut - thanks).

What would be great would be another version of Parcellite, where the text fragments are put there manually, rather than updated when I paste text.
 
Old 11-27-2009, 01:50 AM   #4
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 47
You might look at xsel. This gives the ability to write text from the command line directly into the X selection buffer:

Code:
echo "asdf asdf asdf" | xsel
or from a file:

Code:
xsel < file
Let's say that you have a shell open, then

Code:
$ alias texta='echo text A that I want to paste|xsel'
$ alias textb='echo text B that I want to paste|xsel'
then, whenever you want to past 'text A that I want to paste' into your document, you alt-tab to your shell and type 'texta'. This loads the cut and paste buffer, then you can paste into your application. Same goes for 'textb' and 'text B that I want to paste'.

Granted, it's a little clunky; being able to load copy buffers directly, then paste them with a key combination would be a lot quicker. Still, it's probably better than re-selecting text over and over, especially if you use one-letter aliases.

now, if I could only get this to work with the cut and paste buffer in windows, where I actually need this for my 9-5 job...
 
Old 11-28-2009, 12:35 AM   #5
Chriswaterguy
Member
 
Registered: Apr 2007
Distribution: CrunchBang 10 Statler
Posts: 106

Original Poster
Rep: Reputation: 16
bartonski: thanks, interesting.

So, if no one has made a light program to do this already, all that needs to be done is to build a very simple interface on top of what you've done there, to make it smoother. Actually, I'm not a coder, so... is this simple?

My thought:
* create a simple program that pops up with a list when run. This is where I'm fuzziest - could parcellite be hacked to provide this?
* each item in the list triggers a command when selected. This would be echo "asdf asdf asdf" | xsel for example.
* hopefully the list in the GUI either shows the text to be pasted, or at least can be edited.
* ideally, the text would then also be pasted - to do this the window would have to close itself and operate the paste command in whatever window and edit box you were in previously. Don't know how easy that is.

The program can then be given a hot key by the user, or have one allocated automatically as with parcellite.

So... easy or hard?
 
Old 11-28-2009, 01:33 AM   #6
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 128Reputation: 128
One word: klipper
 
Old 11-28-2009, 09:54 PM   #7
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 47
Quote:
Originally Posted by Chriswaterguy View Post
bartonski: thanks, interesting.

So, if no one has made a light program to do this already, all that needs to be done is to build a very simple interface on top of what you've done there, to make it smoother. Actually, I'm not a coder, so... is this simple?
I don't know; I've never written that type of program (all the stuff I write is text manipulation, mostly in Perl or shell+grep/awk/sed). Having said that, there's not a whole lot there, so it shouldn't be that hard to write.

Come to think of it, I think that xsel comes with an API in C, even that shouldn't be that hard to hack with.

Definitely sounds like an interesting educational project.
 
Old 11-29-2009, 07:29 AM   #8
Chriswaterguy
Member
 
Registered: Apr 2007
Distribution: CrunchBang 10 Statler
Posts: 106

Original Poster
Rep: Reputation: 16
user's own choice of text chunks

Quote:
Originally Posted by Elv13 View Post
One word: klipper
No, that's a heavy (but slightly more fully featured) equivalent of Parcellite. Glipper does the same for GNOME. Those all store a history, rather than the user's own choice of text chunks.
 
Old 11-29-2009, 06:38 PM   #9
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
In KDE, you have knotes; in Gnome, you have gnotes. Add the samples of text to the post-it note, then click on the icon in the tray to bring the notes to foreground when you need them. Highlight the text you want, ctrl-C to copy. Put the cursor in the document you want text pasted into, and ctrl-V to paste.
 
Old 11-30-2009, 03:09 AM   #10
Chriswaterguy
Member
 
Registered: Apr 2007
Distribution: CrunchBang 10 Statler
Posts: 106

Original Poster
Rep: Reputation: 16
post-it options

Quote:
Originally Posted by bigrigdriver View Post
In KDE, you have knotes; in Gnome, you have gnotes. Add the samples of text to the post-it note, then click on the icon in the tray to bring the notes to foreground when you need them. Highlight the text you want, ctrl-C to copy. Put the cursor in the document you want text pasted into, and ctrl-V to paste.
Nice solution, thanks.

There are a bunch of postit package options - I see xpad is installed on my system (probably much lighter than anything Gnome-specific) and xpostit is available and even smaller (29 kB download). There must be others too.

Just have to figure out which is most suitable, with a light footprint (I'm thinking less than 5MB RAM usage, preferably much less), and the least keystrokes & clicks needed.
 
Old 11-30-2009, 08:28 AM   #11
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 47
Quote:
Originally Posted by Chriswaterguy View Post
Nice solution, thanks.

There are a bunch of postit package options - I see xpad is installed on my system (probably much lighter than anything Gnome-specific) and xpostit is available and even smaller (29 kB download). There must be others too.

Just have to figure out which is most suitable, with a light footprint (I'm thinking less than 5MB RAM usage, preferably much less), and the least keystrokes & clicks needed.
You may be able to shave some keystrokes by creating keyboard shortcuts using system->preferences->keyboard shortcuts under gnome. I was trying to work this out last night with my 'xsel' solution. The problem is that I believe that simply launching xsel isn't enough; the process where it is launched from needs to stay open... on the other hand I don't just want to launch processes that I'm not going to terminate, every time I hit one of the keyboard shortcuts. I don't think that these are insurmountable problems, but I haven't had the time to play around with them.
 
  


Reply

Tags
lightweight, paste, text


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inquiry:How to copy/paste in vi text editor hadimotamedi Linux - Newbie 7 08-31-2009 07:58 PM
Which light text editor can copy text from file and paste in browser? davidas Linux - Software 9 03-06-2006 12:28 PM
delete chunks or regions from text file - help K3vin Linux - Software 3 09-26-2005 03:57 AM
paste text from a virtual console to X? Rhatlinux Slackware 1 10-12-2004 09:47 PM
How to copy/paste text from boot, nongui Eradicator Linux - Newbie 2 10-31-2003 06:40 AM


All times are GMT -5. The time now is 08:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration