[linux-elitists] Jef Raskin's "Calculate", or, "save an F key for eval"
Fri Mar 4 11:09:59 PST 2005
Jef Raskin wrote,
All that is really needed on computers is a
"Calculate" button or omnipresent menu command that
allows you to take an arithmetic expression, like
248.93 / 375, select it, and do the calculation
whether in the word processor, communications
package, drawing or presentation application or
just at the desktop level.
That's a really great idea, so I'm going to publish
this Real Working Implementation before some patent
xte 'keydown Control_L' 'key c' 'keyup Control_L' && \
perl -e 'print eval `xsel -b -o`' | xsel -b -i && \
xte 'keydown Control_L' 'key v' 'keyup Control_L'
(That is, copy the selected text into the X clipboard
selection, do a Perl "eval" on the clipboard selection
and replace the contents of the clipboard selection
with the results, then do a paste.)
I now have this bound to the "Access IBM" button on
a ThinkPad. And another way to do it is here,
along with links for where to get xte and xsel.
More information about the linux-elitists