Introduction to TkDesk

by Larry Ayers

Copyright (c) 1996
Published in Issue 8 of the Linux Gazette
This month I'll describe yet another nifty file/desktop manager, TkDesk, written by Christian Bolik. This Tcl/Tk based application has been under development for several years now, and though it is still in the first beta release, it is very stable and dependable.

Current GUI program development for Linux/unix has in recent years diverged into two disparate pathways: Tcl/Tk programs, made up of a series of Tcl scripts which are interpreted at runtime by a "wish interpreter" which does the bulk of the work, and programs which use the proprietary Motif libraries.

I confess to complete ignorance of how well Motif programs perform on a system with the libraries installed. I have run quite a few apps with the libraries statically-linked into the executable, such as Netscape 2.0 and the Moxfm file-manager which I reviewed last month.

I've reached the conclusion that, unless an application has features which can't be found elsewhere (a perfect example is Netscape) the long loading time and increased memory requirements of the statically-linked Motif programs make them in general a second choice.

This circumstance has caused me to gravitate towards non-Motif X applications, and towards the growing number of Tcl-Tk scripted programs which are available. Tk windows even resemble the Motif windows, which I'm sure was intentional. Both user-interfaces have a distinctive "modern" look, easily made evident by placing a Tk and an Openlook window side by side.

The current release of TkDesk requires at least Tcl-7.4 and Tk 4.0; this is the level most distributions install. I would recommend updating to Tcl-7.5 with Tk-4.1, as with these releases shared libraries can easily be compiled. This results in multiple Tk apps using the same libraries. I found out that TkDesk compiled under the 7.4-4.0 releases won't work under the 7.5-4.1 versions, but it's a simple matter to recompile TkDesk.

Features and Configuration

One convenient feature of Tk apps is that the tcl script files are human-readable, editable, and (even if you are not a Tcl/Tk programmer), the syntax is fairly comprehensible. Christian Bolik makes good use of this feature by including a menu which enables you to call up any of several configuration files, using a handy built-in editor. The files are well-commented and enable quite a wide array of changes to the appearance and behaviour of TkDesk. As an added touch, a second pull-down menu will reload whichever files have been modified, facilitating on-the-fly changes.

Here is a link to a screen-shot showing a somewhat customized TkDesk main window:

Main Window

Right-mouse-button menus are a major convenience in this file-manager; they also are configurable via a Tcl text file. As an example, with some help from Christian Bolik I put a new entry in the menu which appears over a directory panel; this one opens an xterm based in that directory.

Navigation across drives and directories is thoughtfully implemented in TkDesk.The default main window shows three directories, and as you open further subdirectories a horizontal scroll-bar appears which enables traversing quite a few levels very quickly. As well as a bookmarking feature, there is a pull-down menu which displays the current session's history of directories visited. This is saved between sessions.

There is an option to display small icons in the directory panes, next to the filename, but this does slow down the display and serves no real purpose.

Another optional feature is a well-designed configurable button-bar, which can have submenus invoked via a right-mouse-button click on an icon.

This button-bar appears on all of fvwm's virtual desktops.

One feature I've found to be useful is the ability to open up a single-pane, single-directory window before moving on to another distant directory. Files can then be dragged and dropped between non-contiguous directories with ease.

A few other features of the built-in editor are worth noting. This is a multi-buffer, single-window editor with its own internal clipboard,i.e., cut and paste doesn't interface with X's system clipboard. As installed it is invoked by double-clicking on any text or shell-script file entry in a directory pane. It appears nearly instantly and is ideally suited to the tweaking of configuration files, both TkDesk's and any others.

Yet another convenience which has been added to the current version is script-based auto-mounting of floppy and cdrom drives. This can easily be configured to mount either msdos or ext2 filesystem floppies, depending on which you use.

A Comparison of TkDesk and the Midnight Commander

As nice as TkDesk is, I have to admit that for maximum speed, the Midnight Commander reigns supreme, especially when run from the a console session. This program has been greatly improved in the last year or so. It's virtual file-system allows opening of gzipped tar files, as well as zip files, as if they were ordinary directories. MC can be used as an ftp client as well, allowing one of the two directory panes to be on a remote filesystem and the other to be on your own disk. This actually works pretty well, though I find myself using ncftp for most file transfers.

The Midnight Commander's major flaw, at least on my Slackware 3.0 system, is its interface with termcap and terminfo. The program comes with termcap and terminfo extensions optimized for MC, but I find that if I install them other apps are adversely affected, such as ncftp in an xterm. Without the extensions MC in an xterm is lacking the home and end keys, for example. I've fiddled with this on and off and have never really gotten it right. The console sessions work well, with color and mouse support, so I mostly run MC in that mode. (Since I wrote this paragraph I've done some more fiddling and now everything but NcFtp works well in an xterm, so it can be done!)

TkDesk is of course much nicer looking, and isn't that much slower. It has a different approach to disk navigation than MC; for some tasks TkDesk's approach is better, for others MC's is well-suited. Of course a shell command-line is often the quickest way to accomplish specific tasks, without the visual overview the file-managers offer.


The current version of TkDesk (version 1.0b1) is available at sunsite and its mirrors; I like the Georgia Tech Site. It is also available from one of the primary Tcl/Tk archives, Neosoft.

The Midnight Commander is also available from Georgia Tech, but the home site in Mexico will always have the latest releases and betas: MC Site

Back up to Linux Gazette T.O.C

Last modified: Sun Jun 2 20:33:30 CDT 1996