Go to gTags Project Page

GTags was written after reading an article in the Wall Street Journal's online edition, and subsequent coverage on the slashdot website. The article concerned Microsoft's inclusion of Smart Tag capabilities in their Office XP suite of applications, and specifically within Internet Explorer.

For more information on gTags, Microsoft's Smart Tags, and why I wrote this program, look here.

Installing gTags

Download gTags from its Source Forge project page. Untar it into a directory, then compile it following the instructions in the INSTALL file.

IMPORTANT: You will also need to copy two files, found in the src directory of the gTags distro: gtags.xml and actions.xml. Copy these two files to your home directory.

The first file associates words ("terms") with a set of actions, and can be edited by the user to add or change tags. Care must be take to ensure the proper XML syntax is maintained.

The second file associates action IDs from the first file with actual programs (such as netscape) to be invoked.

Running gTags

Run gTags by typing

at the shell prompt. The gTags main window will appear. The gTags program is disabled by default, so select "Enabled" from the "Options" menu to activate it. Once activated, any word you select in any X Window application will be checked by gTags. If it matches an existing term in gtags.xml, the gTags window will pop up and let you select actions to take.


The gTags program also has an option to match any text, and present the user with a set of "default" actions. This feature, activated by selecting "Match to Default" in the "Options" menu, is off by default.

You may find the "Match to Default" option annoying during casual use. For example, if you're editing code in xemacs and you select a section of text using the mouse, gtags will pop-up. You can simply turn off the "Match to Default" option to avoid this.

Once activated, you can minimize/iconize gtags and forget about it. It will automatically pop up when you select text that matches a tag (or any text if "Match to Default" is enabled.

The gtags.xml File

The gtags.xml file can be edited to add new tags and terms. Eventually, a nice feature would be to allow importation of tags from other sources, without having to hand edit.

Future Features

I wrote this in part as a learning exercise. While writing it, I thought of other useful features. Other suggestions are welcome.
  • Regular Expressions as terms, for more complex and flexible matching.
  • Only have gtags pop up if text is selected while some meta-key is pressed (ALT, CNTL, SHIFT, etc.). This would prevent gtags from interfering with normal text selection.
  • Better (smarter) positioning of gtags window.
  • Automated importing of additional tags.
  • Smarter parsing of multi-word selections.