![]() |
Xterm Command Typer and Form Filler
Wouldn't it be great to be on your NIT in Xterm, tap a single button at the $ prompt, and have
Code:
sudo gainroot Or to tap a single button and have typed: Code:
/user/home/media/mmc2/myfiles/music Code:
fsck -fy /dev/mmcblk0p2 Similarly, in MicroB (or Links2), wouldn't it be great to have a form-filler, that is, a macro-typing-tool that, faced with a form, could fill in stuff like email addresses and street addresses. If the tool also had password protection and the ability to understand <<tabs>> and <<returns>>, it could securely store and automatically fill in, say, your email address and (automatically including a tab and return) your password; or your log-in; or it could fill in your complete name-and-address, with proper formatting, with one click of a button. Well, such a macro-typer exists for Windows and this is a plea to programmers to make one for Maemo. A key part of what makes this applet so great is that it is always-on-top, but enters the characters wherever the cursor is in the next window down. And it can be quickly minimized to the task bar. (On a Tablet it would ideally minimize to the status bar.) The Windows applet is called TypeItIn. You can download an old freeware version of it here. The current version is substantially more powerful and is available here as shareware. That website also provides a good description of it. Here is a screenshot: http://i248.photobucket.com/albums/g...tInLinus-1.jpg In the panel I made up for this screenshot (the current version allows you to switch among various panels and to decide which of those to password-protect), you could, for example, click "Complete Address" and it would type: Code:
Linus Torvalds Code:
fsck -fy /dev/mmcblk0p2 (If this looks familiar, it's because I'd tried to arouse interest in such a project once before. Rbrewer123 and Benson posted some ideas there that might be useful.) |
Re: Xterm Command Typer and Form Filler
Code:
$ echo "alias music='cd /user/home/media/mmc2/myfiles/music'" > $HOME/.profile |
Re: Xterm Command Typer and Form Filler
Quote:
Since the author says, Quote:
|
Re: Xterm Command Typer and Form Filler
This is nice, but my current Xterm supports Sudo Gainroot with a single click and apt-get update with a single click. I just used the settings available now. I could create more, but these are the ones I use most.
|
Re: Xterm Command Typer and Form Filler
Well, with xte, anything that runs commands can do it; so any of Personal Menu, CmdNav, osso-statusbar-cpu, powerlaunch, and probably others will do. Trouble is, they don't give you the always-on-top window you want, so you have to launch them with the panel, or with the power button, in the case of powerlaunch.
|
Re: Xterm Command Typer and Form Filler
Personal Navigator will allow you to launch command in xterm, but there is an annoying bug with xterm which opens two window when doing this. I don't think there is anyway to get it to type text in a currently open xterm.
|
Re: Xterm Command Typer and Form Filler
Thanks all for the Command Navigator/Personal Menu recommendation. Personal Menu is a great app, much better than my old Simple Launcher.
HOWEVER, it still leaves me wanting a macro typing tool. It would be such a boon for the tablet. Here is fiferboy's reply to my question about using Personal Menu for form filling (fiferboy is PM's creator): Quote:
(I'm thinking about making some comments here about the iPod Touch and how it compares to the NITs, just to keep the thread alive until some developer gets the bug to code a macro typing tool. :) ) |
Re: Xterm Command Typer and Form Filler
You could make an xkbd layout that.would type in leters with a single buttons.
|
Re: Xterm Command Typer and Form Filler
Starting with fiferboy's advice,
Quote:
1. First, there's Snippits. I have a feeling this is the most developed but is problematic since it "can work from any system that supports the Ruby programming platform." Does that kill it for maemo purposes? Or is that a good thing? Here's a Lifehacker article called "Automate Repetitive Typing with Snippits.". It includes this YouTube video of Snippits in action. Snippits has some weird, extra capablities, like it can grab info from the internet and put it in with what you're typing. It can also automatically enter formatted dates, times, etc. FWIW, here's a How-To thread on ubuntuforums. 2. Next, and good since it's Python-based, is Autokey. "It listens to keyboard events on /dev/input/eventX and uses the python-xlib library to send xtest events to drive the expansions." It, too, has a YouTube video and an example abbr.ini file. 3. There are various Firefox add-ons, which would need porting to MicroB. I like the idea of an applet that can automatically enter text in any maemo program, but a MicroB browser add-on would address most needs. I need to test these still, but the obvious ones seem to be: Clippings, Fireform, and Formfiller. |
Re: Xterm Command Typer and Form Filler
Post #9, directly above, is much more important than this one, but I couldn't resist ...
Doing my research for the preceding post, I came across plenty of Linux users wishing there were an automatic-text-entering tool like TypeItIn. For example: "i've just spent the last hour searching many linux software sources. i'm looking for a program where i can set up keyboard shortcuts that will enter text strings into various applications. under windows there is typeitin, and also a utility made by pc magazine called robotype. anyone recall seeing something similar?" "I am trying to find an application that i can use to send keystrokes to other applications. For example in windows i used to use a program called typeitin " "TypeItIn lets you define buttons that will insert any information you want in any Windows application ... Is there a Linux equivalent?" "The one Windows ap I cannot live without is a little one that saves phrases of indefinite length and lets you insert one you select by clicking on one of an indefinite number of buttons. And it works with any application! Is there something like that for Linux?" |
Re: Xterm Command Typer and Form Filler
gxmessage + xte FTW?
I don't have time to rig it up right now, but it's really trivial. Only suboptimal bit is launching.... |
Re: Xterm Command Typer and Form Filler
I learned about the power of macros back in the 1980s or so with version 4 something (4.23, my mind suggests!) of WordPerfect, and they certainly were handy. In a tablet they would be more handy than ever because typing is more difficult than with a full-fledged keyboard. What caused me to be less enthusiastic about this idea is that it was said to be primarily needed for typing in an xterm. I don't want it for typing in an xterm; I want it for typing in Notecase or other cool programs that we already have that could clearly be enhanced by macros.
There is, for example, an excellent web-based mind-mapping program called Mindmeister. It works pretty well on my N800, but a few key-hits are not available because they involve Ctrl keys or other keys the N800 doesn't have. So, I rarely use it on my N800. Macros would probably transform the Mindmeister experience. |
Re: Xterm Command Typer and Form Filler
Quote:
Quote:
Quote:
(And, by the way, Geneven, for the past three weeks I've been using this trick, too, to autotype "sudo gainroot" in Xterm.) |
Re: Xterm Command Typer and Form Filler
Quote:
|
Re: Xterm Command Typer and Form Filler
gxmessage does dialog boxes from a script; xte pushes key events through the X server with xtest. (Naming is a bit of cleverness; it's the successor to xse (X send event) which was pre-xtest.)
|
Re: Xterm Command Typer and Form Filler
Script:
Code:
#!/bin/sh Code:
string1,string2,string3 This can also be converted to use a list, but then you'd have to select an entry and then click OK. I thought this was better. As I said before, the trouble is launching it; Edit: it is always-on-top... Attempt at reducing screen footprint and looping coming right up. |
Re: Xterm Command Typer and Form Filler
Quote:
Quote:
|
Re: Xterm Command Typer and Form Filler
Well, that only works if you're not running fullscreen... Else there's non-trivial cost to launching it. So I was thinking a persistent, always-on-top window would be best.
Oh, that attempt... Sorry to leave you in suspense; it was an utter flop. What's there is the best you're gonna get by this approach. Did you try it? Personally, if I wanted this kinda thing, I'd be inclined to use Personal menu for regular menu stuff, and stack command-navigator full of typing shortcuts like this: Description: Foo |
Re: Xterm Command Typer and Form Filler
Quote:
In PM, I entered Code:
Hello Code:
xte 'str Hello' From Run As Root, nothing happens. From Run In Terminal, I get Code:
sh: xte: not found I don't know what xte is, but I don't see it in installed or installable applications, nor in gronmayer repositories. So, if you'd be so kind, I could use some education. Thanks! |
Re: Xterm Command Typer and Form Filler
I mean the old command navigator; I'm running both, so I get two menus. (One 40px, for friendly fingers, and the other (cmd-nav) packed closer.) But if you only want to run one, then you can certainly do it all in P-menu. (And you seem to be doing it right.)
xte is from Xautomation, I had thought I linked that previously. I'll go find it... [/url]http://www.internettablettalk.com/forums/showthread.php?t=18132&page=2]Here it is[/url]! Download the .tgz, extract it somewhere, and do what you like. ;) I copied (as root, of course) the xte binary to /usr/bin or some such. You could probably also (if not running low on space, and scared like I was at the time) just 'make install' (root, again) from the xautomation-1.02 directory. I recommend that approach, but warn that I did not try it... The xte command doesn't need to be run as root, and as you can see, that masks some feedback, so don't run as root unless needed... As for "what xte is", well, it's a program that stuffs keystrokes (or other events) into an X server. I think you did know what it is, after all... Now you know how to get it. |
Re: Xterm Command Typer and Form Filler
Quote:
At this point I have an xautomation folder (post-gunzipping-and-tarring) in my /usr/bin/ folder. I went into the folder in Xterm, as root, and tried doing this Code:
# ./configure Code:
make install Code:
/bin/sh: make: not found |
Re: Xterm Command Typer and Form Filler
Good instincts, but this time you don't want ./configure and make; the program is already built, so they're unnecessary.
Obviously, you need to have make installed for that plan to work; I do, but evidently it's not default (as I had assumed it was)... I guess falling back to manually copying the one binary needed is sanest at this point. So if I'm reading you right, you have everything in /usr/bin/xautomation-1.02/ ? That's not where I'd have put it, but it'll do. ;) What you want to wind up with is just the file xte in /usr/bin. So, assuming it's in /usr/bin/xautomation-1.02/, do something like Code:
cd /usr/bin/xautomation-1.02/ Code:
cd |
Re: Xterm Command Typer and Form Filler
Well, Benson, I'm getting there. All that stuff for just one little file? I took your advice and moved everything but xte out of /usr/bin/. After a while I'll delete it.
So far I would swear that xte's output is partially random. Your basic idea is being vindicated to my satisfaction. Next I have to get better at xte. I mean it though, xte seems to have a mind of its own. I put in a command or whatever you call it that follows xte in "Command to execute:" in PM. The string has uppercase and lowercase letters, but xte will type only the capital letters. Later I try adding a keystroke for a return. That doesn't work, but after I remove it and go back to exactly the command that I previously had, it starts typing both upper- and lower-case letters. Then I put in a different command (a key shift), but instead of doing what I want, xte goes crazy and keeps typing spaces -- it would type spaces no matter what was open; it seemed there was no way to stop it except by shutting down. Then I go back to what I last had, but now it refuses to type anything but uppercase again. (Actually, what it does is ignore all lower-case input while outputting a lower-case letter for each upper-case character in the requested string!) So, I have more work to do on xte, but it looks like you got me on the track I was asking for. As Arnold would say, I'll be back. |
Re: Xterm Command Typer and Form Filler
With str, it tries to translate a string into key press (and release) events. If you're having trouble with that, you could try to run individual keys, giving you more direct control...
But it was working fine for me; the exact example shown typed Foo quite nicely. <shrug \> There's a man page here: http://linux.com.hk/penguin/man/1/xte.html HTH |
Re: Xterm Command Typer and Form Filler
Quote:
But I've made the macros I want, and I'm a happy camper. If I want, say, "Gerald Ko", I use: Code:
xte 'key Shift_L' "str GERALD " 'key Shift_L' "str KO" So, Benson, thanks! (Now iif fiferboy will just give us a multi-headed Personal Menu -- a MIRV among launchers -- with the capability to password-protect one of its icon-sets, he'll also have the most convenient maemo password manager, filling in the username then tabbing then entering the password all from one click. :) ) |
All times are GMT. The time now is 20:06. |
vBulletin® Version 3.8.8