### -------------------------------------------------------------------------
###
###  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

###
### Whether to display the drag/minimize button on top/left of the appbar:

set tkdesk(appbar,dragger) 1

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

set tkdesk(appbar,max) 19

### =========================================================================
###  Date and Time Button
### =========================================================================

###
### 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

### =========================================================================
###  Mail and System Load Buttons
## =========================================================================

###
### 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.  TkDesk also honors
### the "MAIL" environment variable.
### Note that you can have TkDesk watch multiple incoming mail folders
### by setting the following 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.  Alternatively,
### you can set this to "bell" to have X's bell ring at the arrival of new
### mail.  (Still, you might prefer to use JCC's header flasher below.)

set tkdesk(appbar,mail,notifier) 0

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

set tkdesk(appbar,mail,nomail) mailbox_empty.xpm
set tkdesk(appbar,mail,oldmail) mailbox_old.xpm
set tkdesk(appbar,mail,newmail) mailbox_full.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

###
### Command to use for J. Chris Coppick's incoming mail header flasher
### that is brought up by pressing the middle mouse button over the mailbox
### button (to enable this feature remove the "#" at the beginning of the
### following line; an alternative command may be mailx):

#set tkdesk(appbar,mail,headers,cmd) "mail -H"

###
### Number of seconds to auto-display mail headers when new mail arrives.
### Set to zero to disable auto-display of mail headers.

set tkdesk(appbar,mail,headers,autotime) 5

###
### Background and foreground color, and font to use for the headers window:

set tkdesk(appbar,mail,headers,bg) black
set tkdesk(appbar,mail,headers,fg) yellow
set tkdesk(appbar,mail,headers,font) 9x15bold

### =========================================================================
###  Dial-up Networking Button
### =========================================================================

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

set tkdesk(appbar,dialup,down) next/PhoneTT.xpm
set tkdesk(appbar,dialup,up)   next/PhoneTTOffhook.xpm
#set tkdesk(appbar,dialup,down) next/netscape.xpm
#set tkdesk(appbar,dialup,up)   next/netscape.xpm

###
### The commands to use to bring the dial-up connection up or down:
### (Note: The command specified in tkdesk(appbar,dialup,cmd_up) will
### get the phone number selected in dsk_dialup passed as first 
### argument, to be able to dial the correct phone number.)

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

### =========================================================================
###  Trash Button
### =========================================================================

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

set tkdesk(appbar,trash,empty) next/recycle.xpm
set tkdesk(appbar,trash,full) next/recycle_full.xpm

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

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

### =========================================================================
###  AppBar Definition
### =========================================================================

### 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) {
	{{next/comet.xpm} {
		{{TkDeskܸ  $tkdesk(version)}}
		-
		{¹/... dsk_ask_exec}
		{ե򳫤... dsk_ask_dir}
		{ɥ򳫤... {dsk_ask_dir browser}}
		{ݥåץå... dsk_config_main}
		{硼ȥå... dsk_appbar_main}
		{... {dsk_exec easypr --setup}}
		{... dsk_find_files}
		{bookmarks}
		{եư... history:files history:dirs history:execs}
		-
		{硼ȥå {Ĥ {dsk_appbar layout vertical}} { {dsk_appbar layout horizontal}} { {dsk_appbar raise}} { {dsk_appbar lower}} { {dsk_appbar close}} - {˰ư {dsk_appbar move topleft}} {˰ư {dsk_appbar move bottomleft}} {˰ư {dsk_appbar move topright}} {˰ư {dsk_appbar move bottomright}}}
		{config}
		{λ {dsk_exit 1}}
		{åȥ {exec shutdown -h now}}
	}}
	{{special:date} {
		{ȼĢ}
		-
		{ {dsk_view cal}}
		{ǯ {dsk_view cal -y}}
		{ǯ... {dsk_read_string {Show calendar for year:} {dsk_view cal -y $dsk_read_string    	}}}
		-
		{ {dsk_exec xcalendar}}
	}}
	{{special:load} {
		{ƥ}
		-
		{ץ {dsk_periodic "ps" 60}}
		{ե륷ƥ {dsk_periodic "df" 60}}
		{ȥå {eval dsk_exec $tkdesk(cmd,xterm) -geometry 80x40 -e top}}
		{ͥåȥơ {dsk_view netstat}}
	}}
	{{special:mail} {
		{Żҥ᡼}
		-
		{᡼ dsk_receive_mail}
		{᡼ {dsk_mailer {} {} {}}}
		{᡼ñ dsk_easyconf_mail}
		{᡼ܺ dsk_config_mail}
		-
		{ͥåȥ׼ {dsk_netscape rcmd mail}}
		{ͥåȥ {dsk_netscape rcmd send}}
		{ͥåȥ {dsk_netscape url mailbox:}}
		-
		{᡼ե {dsk_open_dir ~/Mail/inbox}}
	}}
	{{next/Computer.xpm} {
		{ƥ}
		-
		{ü {dsk_exec $tkdesk(cmd,xterm)}}
		{{Rxvt } {dsk_exec rxvt -ls}}
		-
		{CD-ROM { {dsk_open_dir /cdrom}} {Ф {dsk_exec eject /dev/cdrom }} {ޥ {dsk_exec mount /dev/cdrom /cdrom}} {ޥȲ {dsk_exec umount /cdrom}}}
		{ץ {PM760C {dsk_exec pips760 -la JP}} {PM770C {dsk_exec pips770 -la JP}} {PM800C {dsk_exec pips800 -la JP}} {PM820C/3300C {dsk_exec pips820_3300 -la JP}}}
		-
		{Configuration {{.xinitrc} {dsk_edit ~/.xinitrc}} {{.profile} {dsk_edit ~/.profile}} {.Xresources {dsk_edit ~/.Xresources } {{Reread } {dsk_exec xrdb ~/.Xresources}}}}
	}}
	{{next/paintbrush.xpm} {
		{եå}
		-
		{ɥ(Tgif) {dsk_exec tgif}}
		{ɽ {dsk_exec xv}}
		{ {dsk_exec gimp}}
		{ڥ {dsk_exec xpaint}}
	}}
	{{next/netscape.xpm} {
		{󥿡ͥå}
		-
		{ͥåȥ {dsk_exec netscape}}
		{URL򳫤 {dsk_read_string {Open URL using Netscape:} {dsk_netscape url $dsk_read_string window    		}}}
		{X쥯 {򤵤줿URL {dsk_netscape url %x raise}} {ɥ {dsk_netscape url %x window}}}
		{ {TkDeskܸǥ {dsk_netscape url http://www2.famille.ne.jp/~mituiwa/ window}} {Linux {dsk_netscape url http://www.linux.or.jp/ window}} {{FTP(Sun Site)} {dsk_netscape url ftp://sunsite.sut.ac.jp/pub/ window}}}
		{ߥ˥奱 {˥塼 {dsk_netscape rcmd news}} {᡼ {dsk_netscape rcmd mail}} {ۡڡ {dsk_netscape rcmd edit %s}}}
		-
		{&~/bookmarks}
	}}
	{{special:dialup} {
		{륢å³}
		-
		{³/ {dsk_exec tkppxp}}
		{³(pppd) {dsk_exec ppp-on}}
		{(pppd) {dsk_exec ppp-off}}
		{ {dsk_view route}}
	}}
	{{next/win_comp.xpm} {
		{ƥ}
		-
		{ƥ {dsk_exec xawtv }}
	}}
}

proc view_manual_page {names} {
    foreach name $names {
	set l [split $name ()]
	if {[llength $l] == 1} {
	    #dsk_cbhelp "| man $l | col -b" man
	    dsk_view man $l | col -b
	} else {
	    #dsk_cbhelp "| man [lindex $l 1] [lindex $l 0] | col -b" man
	    dsk_view man [lindex $l 1] [lindex $l 0] | col -b
	}
    }
}
