499 lines
26 KiB
HTML
499 lines
26 KiB
HTML
<!--startcut ==============================================-->
|
|
<!-- *** BEGIN HTML header *** -->
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML><HEAD>
|
|
<title>Secret Tools LG #67</title>
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
|
|
ALINK="#FF0000">
|
|
<!-- *** END HTML header *** -->
|
|
|
|
<CENTER>
|
|
<A HREF="http://www.linuxgazette.com/">
|
|
<IMG ALT="LINUX GAZETTE" SRC="../gx/lglogo.png"
|
|
WIDTH="600" HEIGHT="124" border="0"></A>
|
|
<BR>
|
|
|
|
<!-- *** BEGIN navbar *** -->
|
|
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><A HREF="collinge.html"><IMG ALT="[ Prev ]" SRC="../gx/navbar/prev.jpg" WIDTH="16" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="index.html"><IMG ALT="[ Table of Contents ]" SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../index.html"><IMG ALT="[ Front Page ]" SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue67/evans.html"><IMG ALT="[ Talkback ]" SRC="../gx/navbar/talkback.jpg" WIDTH="121" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../faq/index.html"><IMG ALT="[ FAQ ]" SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="fevola.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><IMG ALT="" SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom">
|
|
<!-- *** END navbar *** -->
|
|
<P>
|
|
</CENTER>
|
|
|
|
<!--endcut ============================================================-->
|
|
|
|
<H4 ALIGN="center">
|
|
"Linux Gazette...<I>making Linux just a little more fun!</I>"
|
|
</H4>
|
|
|
|
<P> <HR> <P>
|
|
<!--===================================================================-->
|
|
|
|
<center>
|
|
<H1><font color="maroon">Secret Tools</font></H1>
|
|
<H4>By <a href="mailto:pevans@catholic.org">Paul Evans</a></H4>
|
|
</center>
|
|
<P> <HR> <P>
|
|
|
|
<!-- END header -->
|
|
|
|
|
|
|
|
|
|
<p> <b>H</b>ere is a collection of little-known tools, a couple of which, I find
|
|
extremely useful every single day. I'll warrant that most people have never heard of any of them. O.K., they are not <i>exactly</i> a secret
|
|
- they are, after all, freely available on the net, but they do deserve more than the scant attention they receive.
|
|
</p>
|
|
|
|
|
|
<p>
|
|
Even when you are looking for applications which will perform like '<b>xsnap</b>' or '<b>xclip</b>' they are
|
|
difficult to find. Utilities like '<b>showbook</b>' and '<b>splitvt</b>' are sheer serendipity.
|
|
</p>
|
|
|
|
<ul>
|
|
<li><A href="#xsnap">xsnap</A></li>
|
|
<li><A href="#xclip">xclip</A></li>
|
|
<li><A href="#showbook.pl">showbook.pl</A></li>
|
|
<li><A href="#number.pl">number.pl</A></li>
|
|
<li><A href="#splitvt">splitvt</A></li>
|
|
<li><A href="#wordnet">WordNet</A></li>
|
|
<li><A href="#Keybindings">Keybindings and other Adventures</A></li>
|
|
</ul>
|
|
|
|
|
|
<h3><A name="xsnap">xsnap</A></h3>
|
|
<A HREF="ftp://ftp.ac-grenoble.fr/ge/Xutils/xsnap-1.3.tgz">xsnap</A><br> by <a href="mailto:cbs@cad.cs.cmu.edu">Clauss Strauch</a> at Carnegie Melon University et alia.
|
|
|
|
<p>
|
|
After using 'Snap!' for years, when I made the move to Linux, this was the app I searched high and low to replace. No, xsnap
|
|
doesn't have the OCR capabilities which were a part of 'Snap!', but it's still very useful none the less.
|
|
</p>
|
|
|
|
<p>
|
|
Xsnap is a little app which takes screen-shots. Big deal. Lots of programs exist which do the same thing. The
|
|
difference is that xsnap allows you to capture arbitrary areas of the screen (including entire windows or screens) and it's <i>fast</i>.
|
|
</p>
|
|
|
|
<p>
|
|
When you run <b>xsnap</b> your mouse cursor will change to show an angle shape; simply position the cursor and 'drag' a rectangle describing the area of the
|
|
screen you want in a snap-shot. That's it. Press either 'p' or 'w' in the resulting window to save a numbered snapshot to your home directory.
|
|
</p>
|
|
|
|
|
|
<p>
|
|
It doesn't sound like much, but when you want to email just a portion of an image, or make a little sticky-note for yourself as you peruse a website it's just what you need.
|
|
Actually, taking screen-shots of running apps is the least of what I use xsnap for. Making fast, simple sticky-notes of docs, emails and man pages for just a few minutes
|
|
reference is where xsnap really shines.
|
|
</p>
|
|
|
|
<p>
|
|
Really, just take my word for it, <b>xsnap</b> is tremendously useful, especially when assigned to a hot-key like 'print screen' (what are you using it for anyway?). In
|
|
fact, xsnap is almost wasted if it's not attached to a global hot-key.</p>
|
|
|
|
<p>Unfortunately it saves it's files as 'xpm's. These are <i>very</i> large.</p>
|
|
|
|
<p>
|
|
As always though, we can script our way around such short-comings. Just make a script which processes the file for you on the fly. Here's an example of
|
|
a script I have attached to my hot-key:
|
|
|
|
<pre>
|
|
#!/bin/bash
|
|
# xsnap-jpg. Runs xsnap, converts to jpg and loads electric eyes.
|
|
|
|
xsnap -stdout | xpmtoppm | cjpeg -quality 75 >~/snap.jpg;ee ~/snap.jpg
|
|
|
|
</pre>
|
|
|
|
To save typing it shift-click <A HREF="misc/evans/xsnap-jpg.sh.txt" NAME="link to plaintext">here.</A> Then type 'chmod 755 filename' on the resulting download
|
|
to make it executable. This will function just the same as <b>xsnap</b> except that files will be jpeg and you can do all that <b>ee</b> can do too - also you won't have your
|
|
home dir junked up with numbered files. '-quality 75' is actually the default for <b>cjpeg</b>. Change the '75' to a lower or higher number to get the file
|
|
sizes/quality you prefer.
|
|
</p>
|
|
|
|
<p>
|
|
I should mention that there's one little extra step to compiling <b>xsnap</b>. You will find that it doesn't come with a working makefile or a configure script. To create a
|
|
makefile just type 'xmkmf' ( x make makefile). Then make as usual.
|
|
</p>
|
|
|
|
<img src="misc/evans/snaplupe.jpg" width="158" height="182" alt="snapshot of lupe" align="right">
|
|
|
|
<p>While you're on that same page downloading <b>xsnap</b> , <A HREF="ftp://ftp.ac-grenoble.fr/ge/Xutils/lupe007.tgz">Lupe</A> is a very nice magnifier with a few extras for colour and position (plus it has a cool 'heads-up' style display).
|
|
</p>
|
|
|
|
<h3><A name="xclip">xclip</A></h3>
|
|
<A HREF="http://www.mercuryit.com.au/~kims/xclip/">xclip</A> <br>by <a href="mailto:Kim Saunders (xclip author) <kim.saunders@fortytwo.com.au>">Kim Saunders</a>
|
|
|
|
<p>
|
|
<b>Xclip</b> is a very simple app. Why it wasn't available to Linux users until now is beyond me.
|
|
</p>
|
|
|
|
<p>
|
|
Quite simply, it allows you to place whatever you wish into the clipboard. Period.
|
|
</p>
|
|
|
|
|
|
<p>
|
|
A simple example. Suppose you want to send your friend a directory listing; no problem. Just type "ls | xclip" at your nearest console and
|
|
then middle-click to paste into your email. In fact any program's std out can be piped to xclip: 'whois', 'showbook.pl' whatever.
|
|
</p>
|
|
|
|
<p>
|
|
In combination with a script to grab the currently selected text it becomes even more useful. Suppose you've just typed an unsorted list, but you want it
|
|
sorted alphabetically. Highlight the list with the mouse, press, say, alt-shift-S and then middle-click to paste in the freshly sorted list! This trick can be used
|
|
to do any number of things: sum a column of numbers, make banner-style comment blocks, quick-notes...
|
|
</p>
|
|
|
|
<p>
|
|
<A HREF="misc/evans/clipmanip.py.txt" NAME="link to plaintext">Here's</A> a python script which uses the
|
|
<A HREF="http://web.ukonline.co.uk/julian.smart/wxwin/">wxWindows</A> library to do all of the above. Just attach it to different hotkeys using the appropriate command
|
|
line switch (e.g. 'clipmanip.py -c' to create comment blocks).
|
|
</p>
|
|
|
|
<h3><A name="showbook.pl">showbook.pl</A></h3>
|
|
<A HREF="misc/evans/showbook.pl.txt" NAME="link to plaintext">showbook.pl</A> <br>by <a href="mailto:guido@linuxfocus.org">Guido Socher</a>
|
|
|
|
<p>
|
|
This little gem is indispensable if you have a lot of bookmarks. <b>showbook.pl</b> parses your Netscape bookmark file and returns the URLs it finds there. In fact,
|
|
it's so useful that even though I haven't used Netscape in a couple of months I export my bookmarks file from Konqueror every once in a while just so I can keep
|
|
using it! (nb: Konqueror mangles the syntax slightly, so you'll need to run Netscape once and explicitly save bookmarks to sort things out.)
|
|
</p>
|
|
|
|
<p>
|
|
Here's a sample search using <b>showbook.pl</b>:
|
|
<pre>
|
|
[paul@oremus paul]$ showbook.pl wxwin
|
|
== Misc ==
|
|
<A HREF="http://web.ukonline.co.uk/julian.smart/wxwin/">wxWindows</A>
|
|
</pre>
|
|
</p>
|
|
|
|
<p>
|
|
Yes, I had just used it to grab the URL I needed for wxWindows :-)
|
|
</p>
|
|
|
|
<h3><A name="number.pl">number.pl</A></h3>
|
|
|
|
<p>
|
|
<A HREF="http://www.isthe.com/chongo/tech/math/number/number.html">number.pl</A> <br>by Landon Curt Noll. Email: "number-mail at asthe dot com"
|
|
</p>
|
|
|
|
<p>
|
|
Prepare to be humbled: This man has more degrees than a thermometer. The cv of anyone else looks positively anemic beside that of Mr. Noll's.
|
|
</p>
|
|
|
|
<p>
|
|
number.pl is the most thorough treatment of a "number to words" script I've ever seen. Granted, you may not use it everyday (unless you hook it into your
|
|
cheque register), but it's such a nice piece of perl I had to include it. I normally stop writing at the largest cheque I can conceive the customer to write. Not Mr. Noll:
|
|
</p>
|
|
|
|
<pre>
|
|
[paul@oremus paul]$ number.pl 123456789123456789.12
|
|
one hundred twenty three quadrillion,
|
|
four hundred fifty six trillion,
|
|
seven hundred eighty nine billion,
|
|
one hundred twenty three million,
|
|
four hundred fifty six thousand,
|
|
seven hundred eighty nine
|
|
point
|
|
one
|
|
two
|
|
</pre>
|
|
|
|
<p>
|
|
I've yet to break it.
|
|
</p>
|
|
|
|
<h3><A name="splitvt">splitvt</A></h3>
|
|
<A HREF="http://www.devolution.com/~slouken/projects/splitvt/">splitvt</A> <br>by <a href="mailto:slouken@devolution.com">Sam Lantinga</a>
|
|
<a href="misc/evans/snapsplitvt.jpg"><img src="misc/evans/snapsplitvt_thumbnail.jpg" width="250" height="159" align="right" alt="splitvt snapshot"></a>
|
|
<p>
|
|
<b>Splitvt</b> gives you two consoles in one by splitting the console horizontally. If you click on the thumbnail to the right you'll immediately see how
|
|
handy it is for viewing man pages while you're building a command line. 'Control-W' is used to bounce back and forth between windows.
|
|
</p>
|
|
|
|
<p>
|
|
<b>Splitvt</b> works fine anywhere I've tried it. Everything from the real console to the tabbed notebook of <b>konsole</b>. No problems, very handy.
|
|
</p>
|
|
|
|
<h3><A name="wordnet">WordNet</A></h3>
|
|
Princeton's <A HREF="http://www.cogsci.princeton.edu/%7Ewn/">WordNet.</A> <br>Email: <a href="mailto:wordnet@princeton.edu">Wordnet-email</a>
|
|
|
|
|
|
<p>Anyone who uses English should have a copy of <b>WordNet</b> on their machine. <b>WordNet</b> is a dictionary, not just a spell-checker, but a real,
|
|
honest to goodness dictionary with meanings in context.</p>
|
|
|
|
<p>
|
|
I must warn you that it is about a 10 megabyte download, but it's worth it and you only need to do it once. Here's some sample output from 'wn' ( the executable program
|
|
that comes with <b>WordNet</b>) using the word 'date':
|
|
</p>
|
|
|
|
<pre>
|
|
|
|
Overview of noun date
|
|
|
|
The noun date has 8 senses (first 8 from tagged texts)
|
|
|
|
1. date, day of the month -- (the specified day of the month; "what is the date
|
|
today?")
|
|
2. date -- (a particular day specified as the time something will happen; "the
|
|
date of the election is set by law")
|
|
3. date, appointment, engagement -- (a meeting arranged in advance; "she asked
|
|
how to avoid kissing at the end of a date")
|
|
4. date -- (a particular but unspecified point in time; "they hoped to get
|
|
together at an early date")
|
|
5. date -- (the present; "they are up to date"; "we haven't heard from them to
|
|
date")
|
|
6. date, escort -- (a participant in a date; "his date never stopped talking")
|
|
7. date -- (the particular year (usually according to the Gregorian calendar)
|
|
that an event occurred; "he tried to memorize all the dates for his history
|
|
class")
|
|
8. date -- (sweet edible fruit of the date palm with a single long woody seed)
|
|
|
|
Overview of verb date
|
|
|
|
The verb date has 5 senses (first 3 from tagged texts)
|
|
|
|
1. date -- (go on a date with; "Tonight she is dating a former high school
|
|
sweetheart")
|
|
2. date, date stamp -- (stamp with a date, as of a postmark; "The package is
|
|
dated November 24")
|
|
3. date -- (assign a date to; determine the (probable) date of; "Scientists
|
|
often cannot date precisely archeological or prehistorical findings")
|
|
4. go steady, go out, date, see -- (date regularly; have a steady relationship
|
|
with; "Did you know that she is seeing her psychiatrist?" "He is dating his
|
|
former wife again!")
|
|
5. date -- (provide with a dateline; mark with a date; "She wrote the letter on
|
|
Monday but she dated it Saturday so as not to reveal that she procrastinated")
|
|
|
|
</pre>
|
|
|
|
<p>
|
|
Whew! Very complete eh? And the above output is actually truncated!
|
|
</p>
|
|
|
|
<p>
|
|
WordNet comes with a tcl/tk front-end which I've never actually had functioning. It seems to insist on an older version of tcl/tk. I normally call it from a hot-key
|
|
(control-shift-E) with
|
|
<A HREF="./misc/evans/english.sh.txt" NAME="link to plaintext">this</A> little script which uses <b>gdialog</b> for input and output. I <i>think</i> gdialog
|
|
comes with most major distributions. <A HREF="http://xdialog.free.fr/">Xdialog</A> is very nice too and basically a drop-in replacement.
|
|
</p>
|
|
|
|
<p>In a similar vein, and to show how easy it is to adapt a script, <A HREF="http://users.erols.com/whitaker/wordslux.htm">WORDS for LINUX (i86)</A>
|
|
is a Latin dictionary you can use the same way. The script is <A HREF="./misc/evans/latin.sh.txt" NAME="link to plaintext">here.</A> In fact I should probably
|
|
make a copy of it which uses <b>showbook.pl</b>... Now, why not round out your bookshelf with a thesaurus? <strong>gThe</strong> is just the ticket. You
|
|
can find it <A HREF="http://sampo.rdx.net/the/">here</A>. <a href="mailto:sampo.niskanen@iki.fi">Sampo Niskanen</a> has done a nice job with this using
|
|
a freely available thesaurus. I would like the gui to accept an argument from the command line though. I must remember to write and ask if he'd do that sometime.
|
|
</p>
|
|
|
|
<h3><A name="Keybindings">Keybindings and other Adventures</A></h3>
|
|
|
|
<p>
|
|
Some of you may be wondering why I haven't mentioned exactly <em>how</em> to attach a program to a hot-key in the first place.
|
|
The answer is a simple one: I don't know.
|
|
</p>
|
|
|
|
<p>
|
|
That is, I don't know how <em>you</em> can do it, because I don't know which desktop you are running. They all seem to employ different methods - if they have
|
|
one at all. What follows here is not an exhaustive study, but I did spend more than a couple of hours playing around. If you know of a method that will work
|
|
globally with every desktop <strong>please</strong> send me an <a href="mailto:pevans@catholic.org">email</a>. My results, outside of two desktops, have been
|
|
abysmal. I've tried the xmodmap route, but, beside the fact that I didn't actually break anything, I didn't achieve anything either... In case it's early in the day for you,
|
|
this is an anguished cry for some <a href="mailto:pevans@catholic.org">help</a> with this one.
|
|
</p>
|
|
|
|
<p><strong>IceWM</strong></p>
|
|
|
|
<p>
|
|
As some may have noticed from the screen-shots, I was using
|
|
<A HREF="http://www.icewm.org/">IceWM</A> at the time. The theme in the screen-shots is my own peculiar blend of "blue plastic" and
|
|
"Photon" (I always wanted LED's that lit up when you clicked them). In fact, I lived in IceWM for a couple of months. It's a very nice, light-weight
|
|
desktop and I found it to be both servicable and stable. If you are using it without <a href="http://members.xoom.com/SaintChoj/icepref.html">IcePref</A>
|
|
(by David Mortensen) and <a href="http://iceme.sf.net">iceme</A> (by <a href="mailto:dmoebius@gmx.net">Dirk Moebius</a>) you are really missing out. Both are
|
|
written in <strong>python</strong>, so you're free to play. The first thing you should do after running <strong>iceme</strong> is use it to add <em>itself</em>
|
|
to the menus. Now, you can have <strong>iceme</strong> whenever you want. Another benifit is that <strong>iceme</strong> has the ability to call
|
|
<strong>IcePref</strong>, so you get the best of both in one go. <strong>iceme</strong> makes it so very easy to make hot-keys that I'm not even going to describe
|
|
the procedure. Both these guys should be sent beer and Swedish cookies at your earliest convenience.
|
|
</p>
|
|
|
|
<p><strong>Sawfish/Gnome</strong></p>
|
|
|
|
Alas<SUP><A HREF="#pournelle">1</A></SUP>, this was one of my failures. I have no idea what I'm doing wrong. The Sawfish configurator had a couple
|
|
of likely looking candidates in the (extensive) list, but I failed to get <strong>xsnap</strong> attached to a key and come up normally. I just <em>know</em>
|
|
that this has to be a manifestation of my own density :-). As I wrote earlier: Help...
|
|
<p>
|
|
|
|
|
|
<p><strong>KDE</strong></p>
|
|
|
|
<p>
|
|
In KDE's 1.x versions there was an app call <strong>khotkeys</strong>. It had a nice gui, but you had to do a little work to make it print arbitrary strings
|
|
(like a long email address at the touch of a key). Since 2.0+ some of that functionality is gone, because it hasn't been re-written yet. However, all of the
|
|
above can be done if you create menu entries for every script and use <strong>kmenu</strong> to assign it a key. Simple.
|
|
</p>
|
|
|
|
<p>
|
|
Simple if you're not running Mandrake. Don't get me wrong, Mandrake's distro is great, Great even. I've been using it exclusively since the 6.2 version. The problem
|
|
is that it doesn't even include <strong>kmenu</strong> and its supporting library. Given that <strong>khotkeys</strong> hasn't yet been ported to 2.x this is
|
|
reasonable, but it leaves us a bit 'out in the cold' when we need hot-keys!
|
|
</p>
|
|
|
|
<p>
|
|
Fear not. There's always a way! Under KDE 2..x there is no need to run <strong>khotkeys</strong> explicitly - it's just there. If you don't want to download
|
|
<strong>kmenu</strong> et al and you are running Mandrake, here's all you need to do:
|
|
</p>
|
|
|
|
<p>
|
|
Load the file "/home/yourdir/.kde/share/config/khotkeysrc" into your favourite editor. It has an entry at the top for number of sections, just increment that by
|
|
one whenever you add a section. You can make entries for things which point to an already existing menu item or you can just make one up. Here is an
|
|
example of each:<br><br>
|
|
|
|
An entry that points to a menu item:
|
|
<pre>
|
|
[Section1]
|
|
MenuEntry=true
|
|
Name=K Menu - Graphics/xsnap-jpg.desktop
|
|
Run=Reference/xsnap-jpg.desktop
|
|
Shortcut=F12<br>
|
|
</pre>
|
|
|
|
An entry that points to just a command line:
|
|
<pre>
|
|
[Section15]
|
|
MenuEntry=false
|
|
Name=calc
|
|
Run=gtapecalc
|
|
Shortcut=Ctrl+1<br>
|
|
</pre>
|
|
|
|
<p>After you have added your changes to the <em>khotkeysrc</em> file you can tell <strong>khotkeys</strong> to re-load its configuration using
|
|
<strong>dcop</strong>. This is an 'InterProcess COmmunication Protocol' or IPC. What this means is that you can 'talk' to programs while they
|
|
are running and tell them what to do. Type 'kdcop' in an xterm to see what's available. Here's the command line to run in order to get <strong>khotkeys</strong>
|
|
to re-read its config:
|
|
</p>
|
|
|
|
<p>dcop khotkeys khotkeys reread_configuration</p>
|
|
|
|
</p>
|
|
|
|
<p>
|
|
There are two other peculiarities with KDE that I should mention. One concerns your environment and the other the clipboard.
|
|
</p>
|
|
|
|
<p>
|
|
First, your menus when you start KDE with Mandrake. Mandrake has written their own, custom 'startkde' script. And with good reason: it spreads
|
|
common menu entries around in a consistent manner. <em>However</em>, this means that whenever you log in to X using KDE, Mandrake's script will
|
|
overwrite the additional entries made by either <strong>kmenu</strong> or yourself. Solution: take write permissions away from everyone - even yourself -
|
|
for the directories and entries that you make by hand in '.kde/share/applnk-mdk'. This will cause a few errors to be written to your '.xsession-errors' file, but
|
|
it will keep your work safe.
|
|
</p>
|
|
|
|
<p>
|
|
Second, Mandrake's re-write of the 'startkde' script (and I'm not kicking against that at all) does not recognize your environment .
|
|
When started from <strong>kdm</strong>, the graphical log-in manager, you end up in a desktop which has no clue to the paths and aliases that you've set up.
|
|
A quick solution to this is to modify Mandrake's 'startkde' script which is found in /usr/bin. Just add these lines near the top:<br><br>
|
|
|
|
source $HOME/.bashrc<br>
|
|
source $HOME/.bash_profile<br><br>
|
|
|
|
This way it reads your environment as if you had begun with 'startx' from a console.
|
|
</p>
|
|
|
|
<p>
|
|
I may, easily, have missed your favourite desktop in this (heck, I only surveyed 3 out of a zillion). Please drop me a line with how yours works.
|
|
</p>
|
|
|
|
|
|
<h3>So, that's it right?</h3>
|
|
Well, nearly.
|
|
<p>
|
|
That's almost it, but I'd be remiss if I didn't talk about the clipboard a bit.
|
|
</p>
|
|
|
|
<p>
|
|
'Windows'/'OS2' has 256 clipboards and so does the 'Amiga'. 'X' has the same - plus. Under 'X' there exists the same, static, 256 clipboard entries <em>plus</em>
|
|
what is called the 'Primary Selection'. This is the text that is actually highlighted at the moment. The 'Secondary Selection' refers to the usual 256 clibboard
|
|
entries. Generally speaking, whatever is highlighted at the moment may be 'pasted' by pressing the middle mouse button. Very slick.
|
|
</p>
|
|
|
|
<p>
|
|
Unfortunately, things can get a bit muddled and you are entirely at the mercy of the toolkit as to how this all plays out. I have noticed that under KDE2x
|
|
<em>something</em> is stealing the selection focus. I've tried turning off <strong>klipper</strong>, but to no avail. In practice, this makes the 'clipmanip' scripts
|
|
useless, because the focus is stolen before you can paste the manipulated clipboard contents.
|
|
</p>
|
|
|
|
<p>
|
|
Fear not brave soul! We can play this game out. If we can't have a general solution, we just have to aproach things a bit, well, side-ways.
|
|
We will not be thwarted by a mere difference in clipboard conventions. With the exception of 'clipmanip -n' we seem to be done for, but don't count us
|
|
out just yet...
|
|
</p>
|
|
|
|
<p>
|
|
We turn for succor to our Trusty Editor. Now, I'm well aware that actually espousing a <em>particular</em> editor is little like offering to choose which
|
|
under-garments you wear, but hear me out on this one.
|
|
</p>
|
|
|
|
|
|
<p>
|
|
We can use the same ideas, but 'shield them from attack' from the destop by doing it all inside our editor. All we need is a friendly editor.
|
|
In strictly geek-speak 'emacs' is cool, because it's written in lisp and it's scriptable in lisp. Now, we, who merely aspire to be <strong>Geeks</strong>, can use
|
|
<A HREF="http://glimmer.sourceforge.net/">Glimmer</A> by <a href="mailto:chicane@reninet.com">Chris Phelps</a>.
|
|
</p>
|
|
|
|
<p>
|
|
<A HREF="http://glimmer.sourceforge.net/">Glimmer</A> is not actually written in python (it's C++), but it's so tightly integrated that one hardly notices. I think
|
|
the <A HREF="http://www.scintilla.org">Scintilla</A> project and <strong>wxwindows</strong> will allow a fully python solution any day now. I've used
|
|
both and they're marvelous. <strong>Glimmer</strong> exposes many of its methods to python and that's what makes it so wonderful. You can script
|
|
anything you want. All you have to do is write a python script and leave it in '/home/yourname/.glimmer/scripts' and it will be added to the 'Scripts' menu.
|
|
Building on what was given to me in the distribution, I offer the <strong>glimmer</strong> equivalents of the above mentioned scripts
|
|
<A HREF="misc/evans/glimmer-scripts.tar.gz">here</A>. They are all self-similar and easy to follow along. I've learned alot since I wrote them, but I'm biting
|
|
the bullet and leaving them the way they were at the time. ( I just took up python a couple of months ago, python/wxwindows is the most sheer fun I've had in years of
|
|
scripting).
|
|
</p>
|
|
|
|
<p>
|
|
Since you've hung in this long, I'll give you one more: <strong>baudline</strong>. This app is such overkill for anything we mortals could apply it to
|
|
, I almost didn't mention it at all. <A HREF="http://www.baudline.com/">Baudline</A> is the <em>King</em> of freely available audio tools. I wrote my thanks
|
|
to the author, but I was a bit worried that he might not appreciate <strong>Baudline</strong>'s demise at my hands: answering the phone. I was wrong. Since then, the author, Erik Olson, has added direct support for both rmd's and mp3's et al. If you need to edit/analyse sound look no further.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
I hope I have, at least, aroused your curiosity about some of these things. With the exception of WordNet, they are all small downloads. Have fun!
|
|
</p>
|
|
<p><strong>Footnotes</strong></p>
|
|
<A name="pournelle"><strong>1</strong></A> If Jerry Pournelle actually has a copyright on this word, I want to plead ignorance now.
|
|
|
|
|
|
|
|
|
|
<!-- *** BEGIN bio *** -->
|
|
<SPACER TYPE="vertical" SIZE="30">
|
|
<P>
|
|
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Paul Evans</H4>
|
|
<CITE>Paul Evans loves everything about electronics and computers in particular. He
|
|
is old enough to remember drooling over an Altair 8080A in his adolescence.
|
|
He and his two children live in the Wilds of Northern British Columbia;
|
|
they're not lumberjacks, but they're OK.</CITE>
|
|
|
|
|
|
<!-- *** END bio *** -->
|
|
|
|
<!-- *** BEGIN copyright *** -->
|
|
<P> <hr> <!-- P -->
|
|
<H5 ALIGN=center>
|
|
|
|
Copyright © 2001, Paul Evans.<BR>
|
|
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
|
|
Published in Issue 67 of <i>Linux Gazette</i>, June 2001</H5>
|
|
<!-- *** END copyright *** -->
|
|
|
|
<!--startcut ==========================================================-->
|
|
<HR><P>
|
|
<CENTER>
|
|
<!-- *** BEGIN navbar *** -->
|
|
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><A HREF="collinge.html"><IMG ALT="[ Prev ]" SRC="../gx/navbar/prev.jpg" WIDTH="16" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="index.html"><IMG ALT="[ Table of Contents ]" SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../index.html"><IMG ALT="[ Front Page ]" SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue67/evans.html"><IMG ALT="[ Talkback ]" SRC="../gx/navbar/talkback.jpg" WIDTH="121" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../faq/index.html"><IMG ALT="[ FAQ ]" SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="fevola.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><IMG ALT="" SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom">
|
|
<!-- *** END navbar *** -->
|
|
</CENTER>
|
|
</BODY></HTML>
|
|
<!--endcut ============================================================-->
|