
Copyright (c) 1999, 2000 by Edward H. Trager
Gt is a simple hack that you can use as a simple text file viewer. However, the real advantage of gt occurs when you want to:
-- and you want to keep your terminal window uncluttered so you can continue to enter commands there.
Just pipe the output to gt and you can continue typing and doing what you were doing, while gt displays the output in a separate window where you can scroll back up or down as needed. gt is smart enough to scroll down to the bottom of the window as more data are received (Fig. 1).
Fig. 1. Output from a "ping" command piped to gt
for continuous monitoring.
I decided to write this utility after I discovered that the Gnome utility gless on my Linux box would not read from STDIN. I have since written the to the author of gless and noted the bug in the Gnome project bug reporter, so eventually this situation will change. Even if it does change, I still prefer gt because:
gt requires the gimp toolkit, gtk+ 1.2 or better, available from www.gtk.org. gt works great -- it won't start to bog down until files become very large, which occurs rarely under normal usage. The following output is what you get when you type gt -h to get help on using it:
gt (c) 2000 by Ed Trager. gtk+ 1.2 (from www.gtk.org) or better is required.
Usage: [<stdout>|] gt [-123hm] [-f <file>] [-t <title>] [<file>]
gt displays piped stdout or a file in a scrollable window.
Switches:
-1 : display 710x210 window at 0, 0.
-2 : display 710x210 window at 50,240.
-3 : display 710x210 window at 100,480.
-f <file> : name of file to read (-f is optional).
-h : display help/usage information.
-m : display Madeline logo in place of gt logo.
-t <title>: Use <title> as the window title.
* Use a pipe to redirect stdout into gt's stdin, e.g.:
tail -f var/log/messages | gt -t "System Messages" &
* Or specify a file to view, e.g.:
gt gt.c &
gt is now distributed with the newest version of Madeline where it is used to view the log files produced while Madeline is running (Fig. 2).
Fig. 2. gt is distributed with the newest version of Madeline.
Commands are included in Madeline's start-up command file to provide interactive
viewing of log files using gt during a program session.
Gt is distributed under the GPL. Gt has been successfully compiled on Solaris and Linux systems.