20080606: * Correctly report an error if xdotool is invoked with an invalid command. * Fix invalid error code reporting from 'windowraise'
Fri, 06 Jun 2008new xdotool version available (20080606)
Hop on over to the xdotool project page and
download the new version.
I've also put up an HTML version of the manpage: xdotool.xhtml.
The changelist from the previous announced release is as follows:
20080606: * Correctly report an error if xdotool is invoked with an invalid command. * Fix invalid error code reporting from 'windowraise'
Comments: 0 (view comments)
Find that lost screen session, episode 2.
Like
I said, I run
screen in all of my xterms...
xterm sets an environment variable in child processes: WINDOWID. This is the X window id of the xterm window. Using this, we can extend upon my last post and come up with a much neater solution. Knowing what screen session you want to bring forward (assuming it's running in an xterm), we can run a command inside that session that grabs the $WINDOWID variable in the shell and uses xdotool to activate the window. session=$(sh screen-find.sh "#freebsdhelp") STY=$session screen -X screen sh -c 'xdotool windowactivate $WINDOWID'Running this causes my IRC window to be activated by xdotool, which means it is now active, focused, and on top. This isn't entirely optimal, because it assumes the xterm attached to that screen session is the xterm that launched it. If you run 'xterm -e screen -RR' and close the xterm (don't log out of the shell), then rerun 'xterm -e screen -RR' it will attach to that previous screen session, but the WINDOWID will understandably not be correct any longer. So what do we do? Using the screen session given, we create a new window in that session and set the title of that window to a generated string. We then use xdotool to search for that string and activate the window. Once we get there, we can kill that new screen window we created and we are left with the terminal holding our screen session sitting in front of us. I wrote a script to do just that tonight: screen-activate.sh. Example usage: screen-activate.sh 24072.pts-25.snack This has a great benefit of supporting every terminal program that understands how to set the terminal window title when screen changes it's title. I have tested my .screenrc in Eterm, Konsole, gnome-terminal, and xterm - all know when screen changes it's title if you put this in your .screenrc: hardstatus string "[%n] %h - %t" termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen (not title yet)\007' # Might need this: termcapinfo * '' 'hs:ts=\E_:fs=\E\\:ds=\E_\E\\'
Comments: 3 (view comments)
|
Search this siteNavigationMetadataHome About Resume My Code (SVN)ArticlesARP 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 '08 Yahoo! Hack Day '06 Unix Essentials Vi/Vim Essentials SSH Tunneling (Video)Tag CloudCalendar
FriendsBarCamp Kent Brewster Tantek Çelik John Resig Wesley Shields Tyler ShieldsTechnorati |
|||||||||||||||||||||||||||||||||||||||||||||||||