### -------------------------------------------------------------------------
###
###  AppBar (TkDesk Configuration File)
###
###  This file defines the contents and appearance of the Application Bar,
###  which can be opened from the "TkDesk" menu.
###
###  *** Press F5 to save changes and reload this file into TkDesk, 
###  *** F6 to do the same plus to close this window.
###
### -------------------------------------------------------------------------

### Whether to let the application bar be managed by the window manager.
### The "disadvantage" of this is that you get a border around the appbar
### window and that the appbar is not automatically present on all virtual
### screens. Note that you can MOVE the appbar by invoking the menu-entry
### "Application Bar/Move..." from the popup menu of the very first button.
### You can then drag the appbar around your screen by pressing the left
### mouse button and moving your mouse simultaneously. Strange, but this
### is by far the MFAQ.

set tkdesk(appbar,wm_managed) 0

### Max. number of buttons in one column resp. row of the application bar
### (when layout is vertical resp. horizontal):

set tkdesk(appbar,max) 19

###
### Definitions of fonts used in the time and date "button" (special:date):

set tkdesk(appbar,font,time) -*-courier-medium-r-*-*-12-*-*-*-*-*-*-*
set tkdesk(appbar,font,weekday) -*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*
set tkdesk(appbar,font,day) -*-times-bold-r-*-*-24-*-*-*-*-*-*-*
set tkdesk(appbar,font,month) -*-helvetica-medium-o-*-*-12-*-*-*-*-*-*-*

###
### Define several aspects of the time display:

set tkdesk(appbar,time,background) black
set tkdesk(appbar,time,foreground) green
set tkdesk(appbar,time,borderwidth) 2
set tkdesk(appbar,time,relief) flat

###
### Set to 1 if you prefer 12-hour time display:

set tkdesk(appbar,12hour) 0

###
### Delay between updates of the load and mail display in seconds:

set tkdesk(appbar,load,delay) 15
set tkdesk(appbar,mail,delay) 30

###
### If your incoming mail folder is not in a standard location, point
### TkDesk to it by uncommenting the following line.  Note that you can
### have multiple incoming mail folders by setting the variable to
### something like {folder1 folder2 folder3}.

#set tkdesk(appbar,mail,folders) {/usr/spool/mail/your_user_id}

###
### Set to 1 if you want TkDesk to bring up an alert box telling you
### which mail folder received new mail when new mail arrived:

set tkdesk(appbar,mail,notifier) 0

###
### Images to be used for the mail notifier (special:mail):

set tkdesk(appbar,mail,nomail) be/mailbox.xpm
set tkdesk(appbar,mail,oldmail) be/mailbox.xpm
set tkdesk(appbar,mail,newmail) be/email.xpm

###
### Background colour to change the mail icon to when new mail arrived,
### use "" if the colour should not be changed:

set tkdesk(appbar,mail,newbg) SlateGray

###
### Images to be used for the dial-up networking button (special:dialup):

set tkdesk(appbar,dialup,down) be/netzwerk.xpm
set tkdesk(appbar,dialup,up)   be/netzwerk.xpm

###
### The commands to use to bring the dial-up connection up or down:

set tkdesk(appbar,dialup,cmd_up)   "/etc/ppp/ppp-on"
set tkdesk(appbar,dialup,cmd_down) "/etc/ppp/ppp-off"

###
### Images to be used for the trash button (sepcial:trash):

set tkdesk(appbar,trash,empty) be/papierkorb.xpm
set tkdesk(appbar,trash,full) be/papierkorb.xpm

###
### Whether to display disk usage of trash folder, and font to use:

set tkdesk(appbar,trash,label) 1
set tkdesk(appbar,trash,font) fixed

### ------------------------------------------------------------------------
### Definition of the Application Bar (AB): The Application Bar is defined
### by the elements of a Tcl list.  (In the following I try to explain its
### structure, although it will probably best to just have a look at the
### example definition below.)
### 
### Each element of the list is again a Tcl list, whose first element is
### the file name of the image to use while the second is another Tcl list
### defining the popup menu associated with that button. If the image file
### name is not absolute, TkDesk will look for the image in each directory
### given by the variable tkdesk(path,images), which is defined in the
### config file "System". Supported formats are XBM, XPM, GIF, and P?M.
### If the image name starts with "special:" it is a special display button.
### Currently the following displays are implemented:
###
###   special:date   - time and date display
###   special:load   - system load display
###   special:mail   - displays the status of your mailbox
###   special:dialup - displays the status of your dial-up network connection
###   special:trash  - displays the status of your trash can
###
### The popup menu list contains usually a set of 2-element lists. The
### first element always gives the label of the menu entry, while the
### second element contains a Tcl script to execute when this menu entry
### is invoked.
### 
### One label has a special meaning: If the label of an entry is "dd", the
### respective action will be executed when files are dropped on the
### button (their names can be accessed via %A in the action
### specification).  One-element lists inside the menu list are handled as
### follows: {-} adds a separator to the menu. If the list is one of
### {history:...}  or {config}, TkDesk will insert the corresponding menu
### at that place.  Otherwise the element is treated as a (disabled) menu
### entry, and can be used for inserting "headlines." Cascaded menus are
### also possible, have a look at the example below to see how they are to
### be defined.
### 
### A single click with the left mouse button always invokes the first
### menu entry of the corresponding popup menu. The menu gets posted when
### the right mouse button is pressed over an AB button.
###
### TkDesk commands that can be used in the list definition:
### (Only the most common ones are listed here. For a complete overview
### and a detailed explanation refer to the User's Guide.)
###
### dsk_exec cmd ...   : Executes shell command cmd in background.
### dsk_path_exec path cmd ... : Execute cmd in path.
### dsk_view cmd ...   : Executes cmd, displays output in Editor window.
### dsk_open_dir path  : Opens a new file list for directory path.
### dsk_open_browser path    : Opens a new file browser for directory path.
### dsk_edit file      : Edits file.
### dsk_du path        : Displays disk usage of directory path.
### dsk_periodic cmd seconds : Executes cmd every x seconds.
### dsk_confirm text script  : Executes script when confirmation was positive.
### dsk_read_string label script  : Executes script when entered string is
###                      not empty. "label" will be displayed in the dialog.
### dsk_sound id       : Plays sound id (defined in config-file Sounds). 
### dsk_cbhelp file regexp   : Invokes TkDesk's help system on file.
### dsk_ask_exec       : Asks for a command to execute.
### dsk_ask_dir        : Asks for a directory to open.
### dsk_save_config    : Saves window layout, history, bookmarks etc.
### dsk_exit ?ask?     : Quits TkDesk. "ask" may be one 1 or 0.
###
### Abbreviations that will be replaced with file names etc.:
###
### %s : Full pathname of the first selected file.
### %f : Its filename only.
### %b : "Basename": just the filename without extension.
### %d : Its directory only.
### %A : List containing full pathnames of all selected resp. dropped files.
### %B : Same as %A, but will be replaced with "" if no files are selected.
### %D : Directory of last "ative" viewer.
### %x : Current X selection.
###
### The very first Button provides access to a few functions of TkDesk,
### like history menus, configuration menu etc. Its labels are mostly
### "internally reserved" keywords.
### The second button is only defined by the magic word "date" which inserts
### TkDesk's date display at that place into the AB.

set tkdesk(appbar) {
    {{be/rakete.xpm} {
	{{TkDesk Version $tkdesk(version)}}
	{-}
	{{Execute/Open...} {dsk_ask_exec}}
	{{Open Directory...} {dsk_ask_dir}}
	{{Open Browser...} {dsk_ask_dir browser}}
	{{Find Files...} {dsk_find_files}}
	{bookmarks}
	{{Visited...}
 	  {history:files}
	  {history:dirs}
	  {history:execs}
	  {{dd} {dsk_openall %A}}
	}
	-
	{{Application Bar}
	  {{Default AppBar} {dsk_reread_config AppBar}}
	  {{Games AppBar} {dsk_reread_config AppBar_Games}}
	  -
	  {{Edit this AppBar} {dsk_edit_configs AppBar_Be}}
	  {{Reload this AppBar} {dsk_reread_config AppBar_Be}}
	  {{Layout}
	    {{Vertical} {dsk_appbar layout vertical}}
	    {{Horizontal } {dsk_appbar layout horizontal}}
	  }
	  {-}
	  {{Move...} {dsk_appbar move}}
	  {{Raise} {dsk_appbar raise}}
	  {{Lower} {dsk_appbar lower}}
	  {{Hide} {dsk_appbar close}}
	}
	{config}
	{{Quit TkDesk...} {dsk_exit 1}}
    }}
    
    {{special:date} {
    	{{Diary and Calendar}}
    	-
    	{{xcalendar} {dsk_exec xcalendar}}
    }}
    
    {{special:load} {
    	{{System Statistics}}
    	-
	{{Processes } {dsk_periodic "ps" 60}}
	{{File Systems } {dsk_periodic "df" 60}}
    	{{Top} {eval dsk_exec $tkdesk(cmd,xterm) -geometry 80x40 -e top}}
    	{{NetStat} {dsk_view netstat}}
    }}
    
    {{be/info.xpm} {
    	{{Documentation}}
    	-
    	{{TkDesk User's Guide } {dsk_help guide}}
    	{{FAQ } {dsk_help faq}}
    	{{Changes} {dsk_help changes}}
	{{TkDesk Homepage } {dsk_netscape url http://tkdesk.sourceforge.net/ window}}
    	-
    	{{Manual Page ...} {
    		dsk_read_string {Show manual page for: (e.g. col(1))} {
		        # view_manual_page is defined below
			view_manual_page $dsk_read_string
    		}
    	}}
    	{{XMan } {dsk_exec xman}}
    	{{TkMan } {dsk_exec tkman}}
    	{{TkMan Remote ...} {
    		dsk_read_string {Show manual page for (requires a running TkMan):} {
    		    catch {send -async tkman \
		    "wm deiconify .man; manShowMan $dsk_read_string"}
    		}
    	}}
    	{{dd} {dsk_view man %f | col -b}}
    }}
    
    {{special:mail} {
    	{{Electronic Mail}}
    	-
	{{Netscape Mail} {dsk_netscape url mailbox:}}
    	{{Elm} {eval dsk_exec $tkdesk(cmd,xterm) -geometry 80x40 -e elm}}
	{{Mail Queue} {dsk_view mailq}}
	{{Directory } {dsk_open_dir ~/Mail}}
    }}
    
    {{be/terminal.xpm} {
    	{{System Management}}
    	-
	{{XTerm } {dsk_exec xterm -T "XTerm" -sb -ls}}
	{{rxvt } {dsk_path_exec /usr/local rxvt -ls}}
	{{Processes } {dsk_periodic "ps" 60}}
	{{File Systems } {dsk_periodic "df" 60}}
	{{Configuration}
    	    {{.fvwmrc} {dsk_edit ~/.fvwmrc}}
    	    {{.xinitrc} {dsk_edit ~/.xinitrc}}
    	    {{.profile} {dsk_edit ~/.profile}}
    	    {{.Xresources}
    	    	{{Edit} {dsk_edit ~/.Xresources}}
    	    	{{Reread } {dsk_exec xrdb ~/.Xresources}}
    	    }
	}
	-
	{{Screen Saver} {dsk_exec xlock -nolock -mode flame}}
	{{Blank Screen} {dsk_exec xlock -nolock -mode blank}}
    }}
    
    {{be/zeichner.xpm} {
    	{{Text Editing }}
    	-
	{{Edit File... } {dsk_edit}}
	{{New File} {dsk_edit "New File"}}
	{buffers}
	-
	{{XEmacs} {dsk_exec xemacs}}
	{{Clipboard} {dsk_exec xclipboard}}
	{{dd} {dsk_edit %A}}
    }}

    {{be/netsurf.xpm} {
    	{{Internet}}
    	-
    	{{Netscape} {dsk_exec netscape -ncols 64}}
    	{{Open URL...} {
    		dsk_read_string {Open URL using Netscape:} {
		        # view_manual_page is defined in file Local
			dsk_netscape url $dsk_read_string window
    		}
    	}}
    	{{X-Selection}
	    {{Go to URL } {dsk_netscape url %x raise}}
	    {{New window } {dsk_netscape url %x window}}
	    {{Desk Item... } {
	        dsk_read_string {Label of URL Desk Item:} {
	            global tkdesk
	            catch {exec mkdir $tkdesk(configdir)/urls}
	            set err [catch {set fd [open $tkdesk(configdir)/urls/$dsk_read_string.url w]} errmsg]
	            if !$err {
	                puts -nonewline $fd %X
	                close $fd
	                dsk_DeskItem .di[dsk_DeskItem :: id] \
	            	    -file $tkdesk(configdir)/urls/$dsk_read_string.url
	            } else {
	                dsk_errbell
	                cb_error $errmsg
	            }
	        } {dontpaste}
	    }}
	}
	{{Locations}
	    {{TkDesk Homepage } {dsk_netscape url http://tkdesk.sourceforge.net/ window}}
	    {{AltaVista } {dsk_netscape url http://www.altavista.digital.com window}}
	    {{Tcl/Tk at Sun } {dsk_netscape url http://www.sunlabs.com/research/tcl window}}
	}
	-
	{{Netscape News} {dsk_netscape url news:}}
	{{ftp sunsite.unc.edu } {eval dsk_exec $tkdesk(cmd,xterm) -e ftp sunsite.unc.edu}}
	-
	{&~/bookmarks}
	{{dd} {foreach f "%A" {dsk_netscape file \$f window}}}
    }}
    
    {{special:dialup} {
    	{{Dial-up Networking}}
    	-
    	{{Connect/Disconnect} {dsk_dialup}}
    }}
	
    {{be/printer.xpm} {
    	{{Printer}}
    	-
    	{{Print Selected } {dsk_print}}
    	{{Print X-Selection } {
    	    eval exec echo [list \{%x\}] | $tkdesk(cmd,print)
    	}}
    	{{Watch Queue } 
    	    {{Default } {dsk_periodic lpq 60}}
    	    {{ascii } {dsk_periodic {lpq -Pascii} 60}}
    	    {{lp1} {dsk_periodic {lpq -Plp1} 60}}
    	}
    	{{dd} {dsk_print %A}}
    }}
    	
    {{be/cdplayer.xpm} {
    	{{Devices}}
    	-
    	{{CD-ROM}
    	    {{Open } {dsk_open_dir /cdrom}}
    	    {{Mount } {
    	    	set err [catch {exec mount /cdrom} errmsg]
    	    	if {$err} {
    	    	    dsk_errbell
    	    	    cb_error "An error occured: $errmsg."
    	    	}
    	    }}
    	    {{Unmount } {
    	    	set err [catch {exec umount /cdrom} errmsg]
    	    	if {$err} {
    	    	    dsk_errbell
    	    	    cb_error "An error occured: $errmsg."
    	    	}
    	    }}
    	}
    	{{Floppy}
    	    {{Open } {dsk_open_dir /floppy}}
    	    {{Mount } {
    	    	set err [catch {exec mount /floppy} errmsg]
    	    	if {$err} {
    	    	    dsk_errbell
    	    	    cb_error "An error occured: $errmsg."
    	    	}
    	    }}
    	    {{Unmount } {
    	    	set err [catch {exec umount /floppy} errmsg]
    	    	if {$err} {
    	    	    dsk_errbell
    	    	    cb_error "An error occured: $errmsg."
    	    	}
    	    }}
    	}
    }}
    
    {{special:trash} {
    	{{Recycling}}
    	-
    	{{Delete Files } {dsk_delete}}
    	{{Open Trash Can} {dsk_open_dir $tkdesk(trashdir)}}
    	{{Empty Trash Can} {dsk_empty_trash}}
    	{{dd} {dsk_delete {%A}}}
    }}
}
