# active.tags.X -- X Window System tag configuration # Nat Friedman # It's actually faster to split up the regexps in many cases. # URLs { Env=X Regexp=http+s?://[^\ "<>'()]+ Binding=Button3 Highlight=Blue SearchLines=4 Action=export NS="`ps auxw |grep netscape |grep -v grep`"; if [ "$NS" = "" ]; then netscape "${}"& else netscape -remote "openURL(\"${}\")"; fi } # URLs that don't begin with "http://" { Env=X Regexp=www\.+[^\ ,"]+/?[^\ ,"<>()]+ Binding=Button3 Highlight=Blue SearchLines=2 Action=export NS="`ps auxw |grep netscape |grep -v grep`"; if [ "$NS" = "" ]; then netscape "${}"& else netscape -remote "openURL(\"${}\")"; fi } # FTP URLs { Env=X Regexp=ftp://[^\ ,<>]+ Binding=Button3 Highlight=Blue SearchLines=2 Action=Action=export NS="`ps -auxw |grep netscape |grep -v grep`"; if [ "$NS" = "" ]; then netscape "${}" & else netscape -remote 'openURL("${}")'; fi } # Resolve an IP address and type the hostname into the shell { Env=X Regexp=[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]? Output=loop Binding=Button3 Highlight=Green Clue=Resolve this IP address and type the hostname into the shell Action=echo -n "`host ${} |grep Name |cut -d ' ' -f 2`" } # Resolve an IP address and pop the hostname up { Env=X Regexp=[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]? Binding=Button3&Shift Highlight=Green Clue=Resolve this IP address and pop up a window with the hostname Action=xmessage "`host ${} |grep Name |cut -d ' ' -f 2`" -nearmouse } # Directory browser { Env=X Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh Regexp=([^\ ]+/) Output=loop Highlight=*Green Binding=Button3 Action=echo -e 'clear;cd ${};ls -F;echo ".."' } { Env=X Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh Regexp=\.\.+ Output=loop Highlight=*Yellow Binding=Button3 Action=echo -e 'clear;cd ${};ls -F;if [ "$PWD" = "/" ]; then echo -n ; else echo ".." ; fi;' } # View images { Env=X Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh Regexp=[^\ ]+\.jpg+|[^\ ]+\.jpeg+|[^\ ]+\.gif+|[^\ ]+\.ppm+ Highlight=Red Binding=Button3 Clue=View this image Action=xv -quit ${} } # View HTML files { Env=X Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh Regexp=[^\ "<>]+\.html+ Highlight=Yellow Clue=Send this HTML file to Netscape Action=netscape -remote "openURL(${})" } # Uncompress and untar .tar.gz and .tgz files. { Env=X Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh Regexp=[^\ "'`=]+(tar\.gz|\.tgz|tar\.Z) Output=Loop Highlight=Magenta Clue=Uncompress and untar this file Action=echo -n "tar -xvzf ${}" } # Unzip .zip files. { Env=X Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh Regexp=[^\ "'`=]+\.zip Output=Loop Highlight=Magenta Clue=Unzip this file Action=echo -n "unzip -v ${}" } # Untar .tar files. { Env=X Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh Regexp=[^\ "'`=]+\.tar Output=Loop Highlight=Magenta Clue=Untar this file Action=echo -n "tar -xvf ${}" } # The following two tags will ghostview a .ps file if you right-click it, # and print it if you shift-right-click it. { Env=X Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh Regexp=[^\ ]+\.ps Binding=Button3 Highlight=Underline Clue=Send this file to ghostview Action=ghostview ${} } { Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh Regexp=[^\ ]+\.ps Binding=Button3&Shift Highlight=Underline Clue=Print this file Action=lpr ${} } #spell check a word { Env=X Regexp=[^\ ]+ Latent=true Binding=Button1&Meta Highlight=Normal Output=loop Clue=Spell check this word Action=xmessage "`echo ${} |ispell -a |grep -v Ispell`" } # End of file