View the project page and/or download keynav-20070629.tar.gz
Update: 20070627 had problems with $HOME so I released a new version (0629).
Wed, 27 Jun 2007New keynav release available
This release of keynav adds necessary support
for configuration files and the benefits obtained from dynamic configuration.
View the project page and/or download keynav-20070629.tar.gz Update: 20070627 had problems with $HOME so I released a new version (0629).
Comments: 0 (view comments)
Mon, 25 Jun 2007xdotool project page posted
I've gotten enough positive feedback about xdotool to convince me to put up a
real project page for it. You can view it here at /projects/xdotool
Comments: 0 (view comments)
Fri, 22 Jun 2007xdo updates: window operations and searching
Today's efforts are summarized best by:
% ./xdotool search "Mozilla Firefox" 31457484 % xwininfo -id 31457484 | egrep 'Width|Height' | paste - - Width: 1278 Height: 1008 % ./xdotool windowsize `./xdotool search "Mozilla Firefox"` 500 500 % xwininfo -id 31457484 | egrep 'Width|Height' | paste - - Width: 500 Height: 500This new 'search' command will walk the list of windows in X and basically output any windows with a matching title, name, or class. In this case, I have 1 "browser" window open under firefox that has "Mozilla Firefox" in the title. So I then resize it to 500x500, trivially. Longer summary of today is that I added 4 new functions to xdotool:
Turns out XTEST works as I'd expect, and this example will do what you think, and switch to the 2nd console (assuming you're running one). % ./xdotool key "ctrl+alt+F2" Goal: Focus the first window found that is a local xterm (ie; not ssh'd anywhere). My xterms have title with 'host(pwd) - activity' in them. So if my local host is 'snack' I can do:
# Look for xterms starting with 'snack(' and focus the first one
./xdotool search '^snack\(' | head -1 | xargs ./xdotool windowfocus
And magically one of the xterms running a shell locally is focused. I can see
this being pretty useful.
Today's code: navmacro-20070622.tar.gz.
Comments: 0 (view comments)
Wed, 20 Jun 2007xdo "beta" release
I've been working furiously on xdo the past few days. Good times :)
The result so far is as follows:
So right now, I can do this:
Interested in the code? Download navmacro-20070620.tar.gz. Note: navmacro works on my ubuntu and freebsd systems just fine. However, xdotool crashes at the end when I do free(xdo->charcodes) only on my Ubuntu system. Uncertain why, I'm way too tired to debug.
Comments: 0 (view comments)
Mon, 18 Jun 2007xdo - do (keyboard or mouse) things in X
Yesterday, I talked about macros. I spent some time coding today and I now have a tool that will let you execute raw keyboard and mouse input into X using the XTEST extension.
The primary example I used was focusing firefox's URL bar without the mouse. The sequence was this: Switch to Desktop 2 (I press Alt+2), focus firefox's URL bar (using control+l) and clear it. The result is a simple tool I'm tentatively calling 'xdo'. You can download the source here. Compile instructions are at the top of the file. The top of xdo.c details the implemented commands, so let's cut to an example: % echo 'key alt+2; sleep 1; key ctrl+l; key BackSpace' | ./xdoIt does exactly what you think. The 'sleep' command has values in milliseconds, and is only necessary to slow down so that events can propgate fast enough (window focus changes, etc). Another reasonable example would be to say "firefox, open a new tab and load the URL in my clipboard": # My clipboard contains a valid url, say, "http://www.google.com/" (echo "key alt+2; sleep 1; key ctrl+l; key BackSpace;" echo "move 55 55; sleep 1; click 2; key Return") | ./xdoSeems complex, but look at what's really happening: Go to desktop 2, focus urlbar, hit backspace (clearing it), move the mouse cursor to 55,55 (a point inside the urlbar for me), hit middle mouse button to paste. Change "ctrl+l" to ctrl+k (unix firefox) to focus the "Search" box instead, and change the 'move' command to cursor over the search box to paste instead, and suddenly you can bind a simple keystroke to search for whatever is in your X clipboard. Useful. One of the neater features is that you can 'type' text: % echo 'type echo hello there; key Return' | ./xdo echo hello there % echo hello there hello there
Comments: 5 (view comments)
|
Search this siteNavigationMetadataHome About Resume My CodeArticlesARP Security Dynamic DNS with DHCP OpenLDAP+Kerberos+SASL PPP over SSH SSH Security: /bin/false Week of Unix Tools Work EfficiencyProjectsfex firefox tabsearch firefox urledit grok keynav liboverride newpsm (FreeBSD) nis2ldap pam_captcha poor man's backup Solaris audio utility xboxproxy xdotool xmlpresenter xpathtool misc scriptsPresentationsYahoo! Hack Day '06 Unix Essentials Vi/Vim EssentialsTag CloudCalendar
FriendsBarCamp Kent Brewster Tantek Çelik John Resig Wesley Shields Tyler ShieldsTechnorati |
|||||||||||||||||||||||||||||||||||||||||||||||||