Currently, TkDesk can be configured only by editing ASCII files. This is not necessarily a drawback, because this way you can add complex Tcl/Tk procedures to the configuration files. GUI based configuration is planned for one of the next releases.
If you don't know Tcl/Tk: Don't despair! For the biggest part of TkDesk's configuration files it is absolutely not necessary for you to know how to program in Tcl/Tk, since you just have to modify values or extend the examples I and others have provided. And to those who want to exploit all of the power available by using Tcl/Tk as TkDesk's configuration language, please have a look at the answer to FAQ Where can I find out more about Tcl/Tk?.
The configuration files can be accessed from the TkDesk
menu
via the Configuration
submenu, or from the
"Configuration" submenu of the popup menu of the
application bar's first button. The built-in editor
will then appear with the selected configuration file(s)
already loaded. Each configuration file contains pretty detailed
comments on what the individual settings are for, and how they can be
modified. Well, at least they contain examples, which can guide your
modification attempts. Once you have modified the configuration file,
you can save it and reload it into TkDesk by making use of the entries of
the editor's "Configuration" menu described in section
The Built-in Editor. Use F5 to save the file
and reload it into TkDesk, and F6 to do the same but additionally
close the configuration file.
As already mentioned, each configuration file contains directions on how to modify its definitions. The general advice is: Simply look at the example definitions, because these make things a great deal clearer than any explanation can.
Tip:
In case your looking for the definition of a specific part of TkDesk,
e.g. for the popup menu of pdf
files, use the
"Find..." entry in the "Configuration" menu.
Just enter pdf
in the "String:" field, hit enter,
and double-click the found file.
All of these are "sourced" (i.e. processed) by TkDesk during start-up. This happens in the following order:
This configuration file lets you define all aspects of the application bar (apart from its layout, use the entries of the submenu "Application Bar" of the desk-button's popup menu for this). This is what you can define here:
This file defines the contents and appearance of the Button Bar,
which is displayed underneath the menu bar of TkDesk's file browser
(tkdesk(button_bar)
)
or file list windows (tkdesk(small_button_bar).
Both button bars are configured independently
from one another.
The third list defined here (tkdesk(dir_button_bar)
) is for
directory-specific button bars which will be dynamically displayed and
hidden when the respective directory is entered or left. These will
be displayed in addition to the standard button bar.
In this file you can define entries which will be added to TkDesk's "Command" menu, for example to uncompress all selected files, manage RPM package files, or do whatever you can possibly imagine.
Here you can define entries and cascaded submenus of directories which will be added to TkDesk's "Directories" menu. More details are contained in the "Directories" file itself.
You can also define a list of directories whose parent directories are not to be displayed in file browser windows, as is usually the case with your home directory. This can speed up display of directories underneath an AFS directory, for instance.
Another list lets you define action that are to be performed when a specific directory is opened. This can be used for example to auto-mount floppies and CDROM's.
Contains definitions for color and font of specific file types (as distinguished by their extension) as well as standard values for regular files, executables, and directories, that will be used in TkDesk's file lists. Also the icons displayed when the "Add Icons" option is selected are configured here, as well as the icons used for the desk items, i.e. files and directories which have been dropped on the root window.
This file does not exist when TkDesk gets installed, but still appears in the "Configuration" menu. This is because if it exists it will be sourced during start-up of TkDesk, so this is the ideal place to put local extensions of TkDesk.
The popup menus that appear when the right mouse button is clicked over a file or directory are defined here. There are individual definitions for the popup menus of directories, executables, and of other files. To find the correct popup menu for a file TkDesk checks the mask of each entry of a popup list one after the other from the beginning of the list to its end, so the masks should become more general towards the end of the list.
An additional popup list (tkdesk(fileops,popup)
) may be
defined here for use in the "Copy, Move, etc." dialog.
Here the command to be used for playing sounds can be defined, as well
as the sound files which are to be played at certain events.
TkDesk comes
with a few AU sound files which are located in
the sounds
subdirectory of TkDesk's library directory. You
can find out where this is by looking at the fifth line of the
tkdesk
script.
All the more "basic" features of TkDesk can be configured here. These are:
Many of the values to be specified for TkDesk's configuration files are Tcl scripts. Also, you can define your own Tcl proc's to use in these scripts. To allow better control of TkDesk, TkDesk externalizes a couple of proc's which could be called the "TkDesk API" (although currently they aren't much more then a random set of more or less useful proc's, but anyway).
The proc's I currently think are part of the API are the following:
Display msg in an alert dialog box.
Display msg in an error dialog box.
Display msg in an info dialog box.
Display msg in a dialog box with "OK" and "Cancel" buttons. Evaluate script if user pressed "OK".
If TkDesk runs in development mode (e.g. by setting the
-devel
command line option) print msg to stderr.
Ask for a directory to open.
Ask for a command to execute or file to open.
Execute command in the background. When the command completes its exit code will be displayed in the status bar of all file browser windows.
Asks for the root password, and executes command in the backgroud under root permission if it was okay.
Execute command in the background and displays its output (stdout and stderr) in a built-in editor window.
Same as dsk_view but asks for the root password first.
Executes command in path and in the background.
Executes command in path and in the background, and displays its output in an editor window.
Without arguments asks for a file to open, or opens all files in the same editor window, positioning the cursor at line linenum if given. If file is "New File" a black editor window will be opened.
Displays mouse as "busy" and locks all TkDesk window from receiving mouse events.
Displays mouse as "lazy", and makes all TkDesk windows responsive again.
Returns information about the currently active file browser or list window: If what is "dir" it returns its directory; if it is "sel" it returns all selected items as a Tcl list; if it is "win" it returns the Tk name of the active window.
If names is not given, copies the full path names of the files selected in the currently active file browser or list window to the X selection. Otherwise just their names are copied.
Displays $msg in a dialog box where the user can enter an
arbitrary string. If script is not given, the string will be
returned; if it is given the variable dsk_read_string
will be
set to the user's input and script will be evaluated.
If "dontpaste" is passed as a third argument to this
command the current X selection will not be pasted into the entry
field.
Opens TkDesk file selection dialog using message as the label, and presetting the entry field with path. Path is also used as the filter for the full file selection box.
For each file all windows displaying the corresponding directory is refreshed. File may also be a directory.
Plays sound if a sound command has been defined and sound is
switched on. Sound is the second index in the
tkdesk(sound,xxx)
array as defined in the
"Sounds" config file ("xxx" in this case).
Opens the "Copy, Move, etc." dialog box, filling in "Source" and "Destination" fields if provided.
Without arguments asks for a phone number, and passes this to the
command specified in tkdesk(appbar,dialup,cmd_up)
, else it
does the same without asking.
Opens the "Find Files" dialog, presetting its fields from
the options. The following options are available: -path
path, -mask mask, -string string, -regexp
regexp, -extreg extreg, -type
"all|file|dir|sym|socket|pipe", -owner
owner, -group group, -modified mod,
-accessed acc, -size size, -case, -samefs,
-followsym. If the option -doit
is given the search will
start as soon as the dialog is displayed, without having to press
"Search".
Asks for an email address where to send file. If file is the empty string, string will be sent instead.
This proc is used to communicate with a running netscape. If Netscape is not running yet it will be started first. What may be "file", "url", or "rcmd" (Communicator only); url may be a regular URL, a file name, or, if what is "rcmd", it may be "mail", "news" or "edit". Args may be "window", or "raise", or both.
Opens the "Periodic Execution" window and executes "command" every "seconds" seconds.
Opens file by performing its default action. Viewer should be given as ""; I just didn't manage to get rid of this obsolete argument yet.
Opens dir in a new file browser window.
Opens dir in a new file list window (unless the option "Always in Browser" is set).
Opens all files if given, or all currently selected files by performing their respective default action.
When specifying Tcl scripts in the popup and appbar configuration
lists (tkdesk(popup,...)
and tkdesk(appbar)
), and in
some other places as well (precide, hus?), you can use a number of
shortcuts that will be expanded just before evaluation:
Will be replaced with the full pathname of the first selected file.
Will be replaced with its filename only.
Will be replaced with its filename without extension ("basename").
Will be replaced with its directory only.
Will be replaced with a Tcl list of the full pathnames of all currently selected files, or of the files dropped on an appbar button.
Same as %a, but replaces with a list of filenames only.
Same as %A but doesn't complain if no files are selected. Instead it will be replaced with the empty string.
Will be replaced with the directory of the currently active file list or browser window.
Will be replaced with the contents of the X selection.
Same as %x but doesn't complain if the selection is empty.
For the "Copy, Move, etc." popup menu; will be replaced of what's been entered into the "Source" text entry field.
For the same popup menu; will be replaced of what's been entered into the "Destination" text entry field.
To make life while configuring TkDesk a little easier as long as there's no GUI configuration available yet, TkDesk provides four little "helper" tools that help with selecting colors, fonts, icons, and sounds, by using graphical mouse-based dialog boxes. These are accessed through the "Configuration" menu, and are basically all handled in the same way.
Each of these dialogs contains three buttons:
Works only correctly if the dialog was invoked from the editor's "Configuration" menu. Inserts the current value at the cursor position in that editor window.
Copies the selected value to the X selection, so it can be pasted at arbitrary places using the middle mouse button.
Closes the dialog.