tkgoodstuff:
an X Button Panel Utility
Version 4.0, Sep 14, 1995
TkGoodStuff for X windows is a utility panel (e.g., a button bar, a
stack of bars, a stack of buttons, bars and stacks of bars,
etc.---vertical or horizontal as you please). It is designed to be
easily configured and modified in the user's ~/.tkgoodstuffrc file.
The main envisioned use is as an always-on-top destop utility to serve
the user's common needs for indicators and buttons. Some "clients"
are included: analog/digital alarm clock, biff, WWW browser launcher,
PPP (or SLIP) net status indicator and toggler, note taker/manager,
calendar program alarm support, POP/IMAP mail fetching support. See
below for some details about the clients.
I originally wrote this thing to make our home computer easier for my
spouse to use for reading email from home; it's been slowly evolving.
My hope is that others will contribute additional clients and send me
suggestions. Thanks to those of you who already have sent me bug
reports and suggestions.
Please let me know about any trouble you encounter, in the
documentation and/or the program.
Table of Contents (this document)
Availability and system requirements:
Get the latest version at
ftp://merv.philosophy.lsa.umich.edu/pub/
To run this utility, you need tcl7.4 and tk4.0 or later (these were
released in July, 1995; find the latest tcl/tk distributions at
ftp://ftp.smli.com/pub/tcl ).
You should get tk/tcl anyway, to run
exmh
(a way-cool mh-based mailer),
ical
(a nice calendar program),
tkman
(great man page interface), etc. The comp.lang.tcl
FAQ ,
and
http://www.sco.com/Technology/tcl/Tcl.html
will help you find more.
To use multicolored icons of the xpm variety, you need (in addition to
libxpm, which you probably have already) a wish interpreter that
understands pixmaps (the standard wish4.0 that comes with tk4.0 does
not). The source for such an interpreter, which I call "xpmwish4.0"
is in
ftp://merv.philosophy.lsa.umich.edu/pub/ (I didn't write this
code; the credits are included).
To run the Dialer (a graphical program to dial your modem, etc.) you need
the expectk program, which means you must install the expect
package after installing tcl and tk (but before deleting the sources!).
Advantages of TkGoodStuff
over Separate Clock, Biff, etc.
- Just one program. Even though we use the farily hungry wish interpreter
(of the tcl/tk language), you
probably will save on memory and cpu usage even if you use only a couple
of the basic clients.
- Just one window, which can be moved about, killed, iconified,
etc., all at once.
- All configuration information in a single rc file.
- Background processes (like mail-checking, calendar-alarm checking,
serial TCP line status checking) are queued together, so that
there is less overlap.
- Clients can easily share information and configuration options
(e.g., there is a global "no beeps" option, which can be set in
the rc file or in the popup menu; PopImap fetches mail when
the net status indicator shows that the net is up, and tells Biff to
be extra vigilant for a while).
- Easy to configure and enhance with simple rc file commands and by
tcl/tk script hacking.
Features
Nifty Included Clients
Several commonly needed "client" items (buttons and indicators)
are provided. These have a good deal of functionality, and are easily
configured. See below for more on the particular clients.
AddButton
The "standard" user-defined buttons can be configured to show either icons
or (multi-line)
text labels or both at once, and global options can request no labels or
no icons. For instance, a simple command in your ~/.tkgoodstuffrc adds
a command button:
AddButton DoNetscape -imagefile mozilla.xbm -text "Netscape" -unixcmd "netscape -ncols 50"
Among the unlimited possibilities here are use of the current X
selection in your command. See the documentation on configuration
files for more.
AddLabelBox
A label box contains text, e.g., to label a group of related buttons.
A simple example:
AddLabelBox NetUtils "Network Utilities"
The Popup Menu
The popup menu is invoked by clicking on the clock. It includes general
functions relating to tkgoodstuff as well as sub-menus added by clients.
Here's a screenshot:
SubStack and EndSubStack
These commands create vertical or horizontal stacks of elements
(e.g., buttons and labels or other stacks), that can be nested indefinitely.
If you're not careful, you might get something like the large example above
(or worse). (A click on the examples will show you the .tkgoodstuffrc files
that produced them).
The Background Task Scheduler
tkgoodstuff maintains a schedule of tasks to execute at regular
intervals. The provided clients schedule tasks of checking the time,
checking for new mail, checking network (PPP line) status, checking for
calendar alarm items, and fetching new mail on a remote POP/IMAP server.
It is quite straightforward to add more.
Included Clients
The "clients" (tcl/tk scripts that produce buttons or displays in the
panel) that are included in this distribution are:
- Clock:
a compact analog and/or digital time and/or date clock. Mouse
button 1 activates the Tkgoodstuff popup menu, with various
switches and actions provided by the individual clients.
- Biff:
a mail checker that (configurably): beeps and "lights up"
the Biff button's icon and/or label when new mail arrives in
your spool file (or other file you specify). Can pop up a summary
of new messages on arrival (also does that on a click of mouse
button 3). Mouse button 2 tells us to treat the current mail in
the watched file as old (so you won't be notified until more mail
arrives).
- Net: indicates the status of a
PPP or SLIP connection and allows you to bring the connection up
or down with a click. Also (if wanted) will periodically "ping"
yourself so that the remote host won't close the connection
because of inactivity. (This client is based in part on tkPPP by
Eric Jeschke.)
Included also is a Dialer program, which you can call from
Net to dial your modem, log you in, and start your network (e.g.,
PPP or Term) software while you watch.
- PopImap:
periodically run pop or imap client to get any new mail
on remote mail server. Don't get too excited: the fetching is
done by a program or script that you provide (e.g., popclient or
imapcopy). No button is produced by this client (though it
produces some stuff in the tkgoodstuff popup menu).
- Jots:
(Beta version of this client.)
A handy tool for writing, editing, and searching for
notes: diary entries, addresses, ftp sources, ideas, etc.
Support for easy shuffling between multiple "folders" of entries.
- WWW:
Button 1 launches your web browser (and it stays down and
inoperative until you exit the browser). Button 3 instructs your
browser (which it starts if necessary) to visit the URL that is
the current X selection. Useful for visiting web pages, etc.,
mentioned in news articles, email, etc.
- Ical:
The program ical (as opposed to this client) is a nice
tk-based calendar program by Sanjay Ghemawat
(http://clef.lcs.mit.edu/~sanjay/ical.html). This client reads
your ical calendar information and serves as an alarm demon,
posting alarm notices to your screen when ical would if you
had it running (and consuming system resources). A popup submenu
allows you to
list the day's ical items (including to-do items as well as
appointments) and to launch ical itself (which you also can do by
clicking mouse button 2 on the clock. Alarm notices come with
buttons and check-boxes allowing you to cancel all alarms, or just
alarms for a particular item.
Installation:
-
Unpack it in a directory somewhere (say, /tmp).
One way (suppose you have the distribution in /tmp/):
cd /tmp
zcat tkgoodstuff4.0.tgz | tar xpf -
- cd to the source directory:
cd /tmp/tkgoodstuff4.0
Then type
wish4.0 install.tcl
A tk installation program (adapted from Sam Shen's tkinspect
installer) will guide you through the very brief process. Probably
the defaults selected will be ok, UNLESS you want xpm icons.
If you have an extended wish interpreter (as opposed to wish4.0
that comes with tk4.0) you may want to use that as your "wish
executable", especially if that interepreter understands xpm's or
other sorts of image not handled by the stock wish4.0. See above for
the ftp coordinates of a simple such extended wish, called xpmwish4.0.
Another wish interpreter that handles xpm's is Tix4.0's
tixwish. However, tixwish take greater system resources, messes up
icon positioning and changes tkgoodstuff's appearance in other ways.
Once you are finished, you can remove the source directory if you
like (all the needed files will have been copied to a library
directory.
- If you have a standard unix spool setup, simply running tkgoodstuff
should give you working Clock and Biff clients (this setup is provided
by the file system-tkgoodstuffrc. Many will want at least to change
the Biff_mailer variable (I use Brent Welch's very nice exmh).
- Configure your own ~/.tkgoodstuffrc file.
- You probably will want to tell your window manager not to put
a border, handles, or a title on tkgoodstuff, and perhaps to leave it
always on top of other windows, and perhaps to make it "stick" in
the same spot on the screen when you move about a virtual desktop.
You may also want it not to be in the circulate list (the list of
windows you go to by hitting alt-TAB or some key sequence). To do
all of this in fvwm add the following SINGLE LINE (broken here for
readability) to your .fvwmrc:
Style "tkgoodstuff" StaysOnTop,NoTitle,NoHandles,Sticky,
WindowListSkip,CirculateSkip,BorderWidth 0
Also, I suggest NOT using fvwm's auto-raise feature, which can
cause havoc with tk popup menus (they get buried by auto raise,
but they "grab" all events, so you can't get them back where you
can click on them). If you think a tk application has "locked up"
your X screen, auto-raise might be why. Comment it out in your
.fvwmrc.
If you use some other window manager, read its documentation---almost
certainly you can achieve most of the same effects.
Documentation
The only documentation for tkgoodstuff is in these html pages, which
are included in the distribution's "doc" subdirectory. From the
"About tkgoodstuff (help)" window accessed from the popup menu, you can launch
a web browser (by default, netscape) to read these pages (either your
local copy or the latest copy on the net).
I hope you'll find this useful. I'd much appreciate any comments,
bug reports, fixes, code-tidying, etc.
Sep 14, 1995. markcrim@umich.edu