Pastelist

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

Pastelist

#1 Post by seaside »

I've always liked having a utility that would insert some predetermined text in any application when needed. Unfortunately, there doesn't seem to be anything for Puppy (except a few application specific ones) and I've seen a number of posts from others looking for this as well.

Since I can never remember abbreviations, I prefer a popup list of possibilities.

With that in mind, I've cobbled together an application called Pastelist.

Pastelist works as follows:

You are in any application and need a stock piece of text, hit a hotkey (in this case the default hotkey is Alt+p) and a dialog file selector pops up. Select a file and enter. The dialog leaves and the text you selected is pasted into the application at the cursor point. (Note: definite feelings of power will rush over you every time you do this). :D

Two programs are involved - Xsel and Xdotool - which do the work of selecting and pasting the text, under the control of the pastelist script.

Installing Pastelist will create a hidden directory (.pastelist in root) which is used to store your stock text files. The jwmrc-personal file (under the .jwm directory) will be appended with the default Alt+p hotkey and you need to restart JWM for this to take place. Note: if you would rather have another hotkey, this can be changed by going to Menu > Desktop > JWM configuration > Keyboard Shortcuts.

Other window managers need to just assign a hotkey to usr/local/bin/pastelist.

Anyway.... here is Pastelist.

UPDATE: August 15, 2009.


A companion program - Picksel - which is designed to be used with Pastelist (selects the text items for Pastelist) can be found here -
http://murga-linux.com/puppy/viewtopic. ... 600#332600

UPDATE: Feb 1, 2010
Pastelist version using xclip
Attachments
pastelist.pet
Pastelist - (using xclip)
(11.79 KiB) Downloaded 967 times
pastelist.pet
Pastelist - a stock text paster
(22 KiB) Downloaded 707 times
Last edited by seaside on Mon 01 Feb 2010, 20:34, edited 2 times in total.

jakfish
Posts: 762
Joined: Fri 18 Jul 2008, 19:09

#2 Post by jakfish »

Great app, fills a perfect niche. I use it to insert em dashes in Abiword.

Thank you, thank you,
Jake

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#3 Post by jrb »

seaside,
This is a fantastic little tool!:) Not only will it paste text into my editor, word processor, spreadsheet, browser, etc. but it can also be used to paste bookmarks into whatever browser I happen to be using. Incredible!

I notice you included /usr/share/applications/pastelist.desktop but it contains no specific info. May I suggest:

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Name=Pastelist text paster
Icon=
Comment=Pastelist
Exec=rox /root/.pastelist/
Terminal=false
Type=Application
Categories=TextEditor
GenericName=Pastelist
Which would give easy access to the /root/.pastelist/ folder.

Well done. This will be included in future ChoicePups.

Thanks, J

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#4 Post by seaside »

Jake,

Thanks for your feedback - seems amazing to be forced to use an entire file just to house an em dash .... :wink:

JRB, (on Rox link desktop file)

Excellent idea. I had created the pet automatically and then when I saw the blank desktop file, I just left it there because there would be no reason to invoke the program except by hotkey. Managing the Pastelist files by a link on the menu or desktop would be an added benefit.

On another note, I just starting thinking about perhaps making a companion utility to create stock Pastelist files easily from highlighted text. This can be done now by manual cut and paste, text editor, etc.., but it might be more convenient to do it directly.

Any interest or comments would be welcome and thanks for your kind words.

jakfish
Posts: 762
Joined: Fri 18 Jul 2008, 19:09

#5 Post by jakfish »

I think that's a great idea--to have a highlight-save-to-file deal. Dunno if you've seen Barry's blog, but it looks like pastelist will be part of 4.4, and as well it should be.

Jake

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#6 Post by disciple »

Interesting... this feature would be a nice fit with glipper or parcellite too, if anyone has some C skills.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#7 Post by trio »

Hi Seaside,

I made up an app called pastecolor

Not really copy and modify your script, but the method and ideas surely came from yours and mix it with ideas from my JWM theme maker

Hope you don't mind, after all it's for puppians

Cheers

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#8 Post by seaside »

jakfish wrote:I think that's a great idea--to have a highlight-save-to-file deal. Dunno if you've seen Barry's blog, but it looks like pastelist will be part of 4.4, and as well it should be.

Jake
Thanks Jake,

I think I'll go ahead and make up something. (Trio has so much good stuff, I'm surprised there's any room left for Pastelist) :D

Disciple -

Before any "C" skills, I need "A", "B" and "Puppy" skills first. :?: - You're right - a tie in with a clipboard manager would be great.

Trio -

You're so clever, it's hard to imagine that anything I produced would be of interest. :D - those two programs -
Xsel and Xdotools are really very handy and I'm going to immediately run over and download Pastecolor to see if there's anything I can learn. :?:

On another topic, do you know if there is a way to have an Xdialog text box exit by a "return" key press. This example:

Xdialog --inputbox <text> <height> <width> [<init>]

will produce a dialog to input text, but it seems that there isn't any way to accept the data by keyboard.

Thanks.

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#9 Post by trio »

Seaside


I don't really get what you mean, but maybe you can use --stdout (like I use to output color) or to use "hit enter key" you may want to take a look at pfind (using gtkdialog)

Cheers

Stormson5150
Posts: 40
Joined: Fri 06 Feb 2009, 16:00

#10 Post by Stormson5150 »

This is a great idea.... Though maybe not so newbie friendly as it could be.

The greatest program I have ever seen of this sort, and infinitely easy to use for both experienced and non-experienced users was written for Win95, named "Populist".

http://krapplets.org/populist.shtml

It is a clipboard utility (like Glipper), however in addition to the extended clipboard (25 entries if memory serves), it also allows for numerous "snippets", which can even be placed in different "trees" (sections).

Unfortunately, it seems this hasnt been updated, and appears to have never been ported for a linux vers... I have looked long and hard for the linux equivalent, and even a vers that would work on XP, but nothing...

I bring this up in the hopes that if you continue with this program, perhaps you could take a look at this and it might give you some ideas... I think something like this (or especially, if exactly like this) could really be one of those "Killer apps" that really turn heads and could help draw others to linux... And of course, it couldnt hurt if it came first from Puppy Linux ;) :D

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#11 Post by seaside »

trio wrote:Seaside


I don't really get what you mean, but maybe you can use --stdout (like I use to output color) or to use "hit enter key" you may want to take a look at pfind (using gtkdialog)

Cheers
Trio,

Yes, "hit the enter key" is what I was looking for and after searching around, there is apparently no way to do that in Xdialog. As you suggested, I looked at Pfind (a great program that I use all the time) and quickly came to the conclusion that I'd better figure out how to use GTKdialog. :D

Thanks

Stormson5150,

Yes, windows has had (and still does) a great number of clipboard utilities that could do just about anything.

I'll definitely check out "Populist" (sounds kind of political :D ) and see if there are any possibilities.

Thanks for your comment.

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#12 Post by trio »

seaside, don't get me wrong, I am not expert or anything, here's to get you started on "hit enter key after typing inside a box"

Code: Select all

#!/bin/sh

export enterbox="
<window title=\"Enter Key Box\" icon-name=\"gtk-help\">
<vbox>
    <text><label>\"\"</label></text>
    <entry activates-default=\"true\" width-request=\"300\">
     <variable>ECHO</variable>
     <input>echo 'Type a word an press enter key'</input>
    </entry>
    <hbox>
     <button can-default=\"true\" has-default=\"true\" use-stock=\"true\">
      <input file stock=\"gtk-apply\"></input>
      <action>gxmessage -center -bg orange \"\$ECHO\"\ &</action>
      <action type=\"exit\">0</action>
     </button>
    </hbox>
</vbox>
</window>"

gtkdialog3 --program=enterbox

unset enterbox

exit 0

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#13 Post by seaside »

trio wrote:seaside, don't get me wrong, I am not expert or anything, here's to get you started on "hit enter key after typing inside a box"

Code: Select all

    <entry activates-default="true" width-request="300">
    
Trio,

You've got it! That's it. :D

Even though GTKdialog is more powerful, it seems to me that Xdialog is much easier. Have you tried Glade to design any of your programs? It seems very complicated to me :?:

Many thanks

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#14 Post by trio »

Yes, once I made up a wallpaper express setter with preview

It supposed to be easy with the help of glade builder gui, but I like gtkdialog better

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#15 Post by seaside »

I have uploaded a companion pet called Picksel which selects text and saves it to a file in /root/.pastelist. It can be found here -

http://murga-linux.com/puppy/viewtopic. ... 600#332600

:idea:

(Thanks to Trio for supplying the "mouse clicking avoidance" technique)

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#16 Post by disciple »

It could alternatively use xclip rather than xsel, as xclip is already included in puppy :)
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#17 Post by seaside »

disciple wrote:It could alternatively use xclip rather than xsel, as xclip is already included in puppy :)
disciple,

Probably could if xclip can handle text in the same way as xsel does.

Another 23k trim available :D

s

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

Pastelist (light with xclip)

#18 Post by seaside »

Ok,

Just to keep the puppy slim , might as well cut out another program and use puppy's standard xclip..

No functional differences as far as I can see and it's just a change to the Pastelist script and the removal of Xsel.

The xclip version is on the first post.

Cheers,
s

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#19 Post by disciple »

:)
That's the Puppy spirit :)
BTW, thanks for bringing xdotool to our attention - it is fantastic.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

Post Reply