DASH(1) USER COMMANDS DASH(1) NAME dash - Athena Dashboard SYNOPSIS dash [-toolkitoption ...] [-menus _f_i_l_e] [-appdefs _f_i_l_e] [- userdefs _f_i_l_e] [+-rude] [+-verify] [-kill] [-restart] [-run] [-send] [-show _o_p_t_i_o_n ... ] [-hide _o_p_t_i_o_n ... ] [+-options ...] DESCRIPTION By default, _d_a_s_h places a menu bar at the top of the screen which contains much useful information on using Athena. Some of the items in the menu are merely informational - clicking on the items themselves will do nothing, while clicking on the `?' next to them will offer information. These items are followed by ellipsis (...) in their name. Other items will do things when you click on them, such as "New xterm window" under the special menu. These items also offer information if you click on their `?'s. Still other items are submenus. They have an arrow next to them where other items have `?'s, and clicking on the arrow will show more items. New Athena users should find this program massively useful for finding things, while more experienced Athena users may still like the program because of its customizability. More generally, _d_a_s_h puts up user-defined widgets on the display screen which place much less of a load on the system than their X Toolkit or Motif counterparts. _D_a_s_h can create menus, analog and digital clocks, buttons, icons, and other widgets which will be added in the future. Replacing other screen accessory programs with _d_a_s_h widgets can signifi- cantly increase system performance, especially on older sys- tems with less real memory. For example, _d_a_s_h can emulate the _x_l_o_g_o_u_t program on a vax in 220K of memory space as opposed to 440K for the X Toolkit version of _x_l_o_g_o_u_t. Much more significantly, _d_a_s_h can replace several screen accessories at a fraction of the cost of running each separately, as each added widget adds only a few kilobytes of memory to _d_a_s_h'_s running size. _D_a_s_h con- figured to put a clock and logout button on the screen will use 222K on a vax, compared to the 760K required to run _x_c_l_o_c_k and _x_l_o_g_o_u_t together. On older workstations which often have only four megabytes of memory, the difference in system response time is immediately noticeable. _D_a_s_h'_s menu widget is of special note. It allows the user to specify a list of desired menu items and their general desired locations, and will assemble a menu hierarchy from this description, rather than requiring the user to specify a complex hierarchy. See the MENU FORMAT section below for Sun Release 4.1 Last change: Nov 16, 1990 1 DASH(1) USER COMMANDS DASH(1) details and an example on specifying menu widgets. TOOLKIT OPTIONS _D_a_s_h accepts many of the standard X Toolkit command line options: +-reverse +-rv This option causes _d_a_s_h to come up in reverse video if you specify -rv, normal video if you specify +rv (the default). -background _c_o_l_o_r -bg _c_o_l_o_r This option specifies the default background color for all _d_a_s_h widgets. -bordercolor _c_o_l_o_r -bd _c_o_l_o_r This option specifies the default border color for all _d_a_s_h widgets. -borderwidth _n_u_m_b_e_r -bw _n_u_m_b_e_r This option specifies the border width for all _d_a_s_h widgets in pixels. -display _d_i_s_p_l_a_y This option specifies which display _d_a_s_h is to run on. The default is to use the DISPLAY environment variable. -foreground _c_o_l_o_r -fg _c_o_l_o_r This option specifies the default foreground color for all _d_a_s_h widgets. -font _f_o_n_t_n_a_m_e -fn _f_o_n_t_n_a_m_e This option specifies the default font for labels on _d_a_s_h menus and buttons. -name _s_t_r_i_n_g This option specifies the application name under which resources are to be obtained, rather than the default executable file name. _S_t_r_i_n_g should not Sun Release 4.1 Last change: Nov 16, 1990 2 DASH(1) USER COMMANDS DASH(1) contain ``.'' or ``*'' characters. -xrm _r_e_s_o_u_r_c_e_s_t_r_i_n_g This option specifies a resource string to be used. This is especially useful for setting resources that do not have separate command line options. See _X(1). DASH OPTIONS _D_a_s_h accepts the following additional options: -appdefs _f_i_l_e This option specifies a file to use for the applica- tion default resources instead of the default /usr/lib/X11/app-defaults/Dash. -userdefs _f_i_l_e This option specifies a file to use for the user default resources instead of the default ~/.dashrc. -menus _m_e_n_u_f_i_l_e This option causes _d_a_s_h to read menu entries from _m_e_n_u_f_i_l_e instead of the default menus file listed in the "*Menu.file" resource. If more specific menu file resources are specifed, they will not be over- riden by this option. +-rude Specifies whether or not _d_a_s_h grabs the mouse pointer whenever one of its menus is opened. -_r_u_d_e causes the pointer to be grabbed and is the default. +_r_u_d_e leaves the pointer free while menus are open; this allows to you work in other windows without closing _d_a_s_h menus first. +-verify Specifies whether or not _d_a_s_h attempts to verify all menu-selected actions (i.e. callbacks) by popping up a dialog box which asks the user to confirm or can- cel the action. +_v_e_r_i_f_y will cause _d_a_s_h to turn off verification for all menu item callbacks. -_v_e_r_i_f_y will cause dash to verify any menu item callback. Menu items configured with the -_v_e_r_i_f_y field (see MENU FORMAT) are never verified regardless of this resource. Note that -_v_e_r_i_f_y as a command line option turns verification on for all items, while -_v_e_r_i_f_y in a menu configuration will turn verifica- tion off for a specific item and override the com- mand line option. Yes, this is confusing, but Unix and toolkit conventions dictate the meaning of the + and - command line options. Sun Release 4.1 Last change: Nov 16, 1990 3 DASH(1) USER COMMANDS DASH(1) By default, typing "dash" causes _d_a_s_h to start up showing a menu bar. However, if there is already a _d_a_s_h running, it will tell that one to display a menu bar instead. The fol- lowing options can be used to specify whether such messages are sent, or what messages should be sent. -kill This sends a signal to the currently running _d_a_s_h telling it to exit. -restart This is the same as -kill, except that after sending the kill it continues to run, and becomes the currently running _d_a_s_h. This is useful if you want _d_a_s_h to be running with resources you have just changed. -send _D_a_s_h usually checks to see of there is already a _d_a_s_h running. If so, it sends a signal. If not, it starts on its own. The -send option specifies that _d_a_s_h should only send signals. If there is no _d_a_s_h running, one should not be started. -run This option tells _d_a_s_h to ignore any other _d_a_s_h's that may already be running, and start up no matter what. -hide _o_p_t_i_o_n ... -show _o_p_t_i_o_n ... +-_o_p_t_i_o_n ... These options are the reason that _d_a_s_h's signal sending ability exists. With them, you may tell an already running _d_a_s_h to hide or show objects that it is or isn't showing. This is good, because if _d_a_s_h were started as a logout button, and you wanted it also to be a menu bar, you might just start up a second invocation of _d_a_s_h, consuming more worksta- tion memory. Instead, you can tell the _d_a_s_h that is already running to do display the menu bar, and save resources. For example, "dash -show clock" will send a signal to an already running _d_a_s_h to create a clock. If no dash is already running, it will start a new dash running the clock instead. Similarly, "dash -hide clock" will cause an already running dash to hide its clock, if one was showing. "dash -clock" is equivalent to "dash -show clock," while "dash +clock" is the same as "dash -hide clock." _O_p_t_i_o_n may be any of: default, user, athena, menubar, logout, clock. "default" is equivalent to "athena user," and "athena" is equivalent to Sun Release 4.1 Last change: Nov 16, 1990 4 DASH(1) USER COMMANDS DASH(1) "menubar." Invoking _d_a_s_h without any of these options is equivalent to invoking it with "-default" or "-show default". Thus, if there is _d_a_s_h running as only a logout button, simply typing "dash" will cause it to display a menu bar as well. RESOURCES _D_a_s_h understands many, although not all, of the core X Toolkit resources (see _X(1)) and many additions which will be documented in the near future. For now these resources which significantly affect _d_a_s_h'_s behavior are listed for reference: overrideRedirect Specifies whether windows created by _d_a_s_h are created with override redirect set. Most window managers will not decorate or allow the user to drag around windows with this set. Override redirect is set by default on _d_a_s_h's menu bar, but not on any of the rest if its windows. If you wish to try it without this set, try specifying "*menuTree.window.overrideRedirect: False" in resources. rude Specifies whether _d_a_s_h keeps the mouse grabbed when one of its menus is opened. The default is "True". Specfiying "dash*rude:False" will allow you for example to click away zephyrgrams while leaving a menu open. verify Specifies whether menu item callbacks are executed with or without a popup verification window first. Default is "True". Menu items configured with the -_v_e_r_i_f_y field (see MENU FORMAT) are never verified regardless of this resource. autoRaise Specifies whether a _d_a_s_h menu widget will automati- cally be brought to the front of the screen whenever the mouse enters it. Default is "True". DASH WIDGETS The widgets which _d_a_s_h can create are still growing, and could use extensive documentation of their own in the future. Especially important are the _T_r_e_e widget and _F_o_r_m Sun Release 4.1 Last change: Nov 16, 1990 5 DASH(1) USER COMMANDS DASH(1) widget, which are used to create other widgets in and organ- ized manner. Until extensive documentation is available, an example of correct use of trees and forms can be found in /usr/lib/X11/app-defaults/Dash, which creates a small tree of widgets and includes several which are commented out for reference. The list of currently available widgets is: Tree, Form, Win- dow, DigitalClock, AnalogClock, Menu, Icon, Button, Label, NULL. MENU FORMAT _D_a_s_h has a unique menu format which allows one to create lists of menus and menu items and allow _d_a_s_h to assemble them in the appropriate hierarchy. The same item can appear in more than one menu. Items can have both help panels which provide information upon selection, and callbacks which perform actions upon selection. The format of a menu file consists of entries each ter- minated with a ';' character, and each containing one or more of the following fields. Multiple entries and fields may exist for the same object -- subsequent definitions of individual fields will override previous ones. menu _n_a_m_e: _N_a_m_e will be created as a menu or submenu, and may have menus or items under it in the final menu hierarchy. A _m_e_n_u entry should also have a _l_a_b_e_l, a _p_a_r_e_n_t, and a _c_h_i_l_d defined (see below). item _n_a_m_e: _N_a_m_e will be created as an item which goes onto one or more menus, and may have help associated with it. An _i_t_e_m entry should also have a _l_a_b_e_l and a _p_a_r_e_n_t defined. help _n_a_m_e: If _i_t_e_m _n_a_m_e exists, a help entry for it will be created which will appear next to _n_a_m_e on any menus on the screen. If the help entry rather than the item is selected, the helptext (see below) will appear in a window next to the menu on the screen. _l_a_b_e_l Used with a _m_e_n_u or _i_t_e_m (see above) entry, speci- fies what label the menu or item will be given on the screen. Sun Release 4.1 Last change: Nov 16, 1990 6 DASH(1) USER COMMANDS DASH(1) _h_e_l_p_t_e_x_t Used with a _h_e_l_p entry, specifies what help text will appear when the help entry is selected. [_p_a_r_e_n_t, _p_a_r_e_n_t ... ][_p_a_r_e_n_t ...] Used with a _m_e_n_u or _i_t_e_m entry, specifies what menus are allowed to be parents of the entry in the hierarchy. The entry will become a child of the first available parent specified in each set of brackets (see example below). A [NULL] parent specifes that the entry should be at the top level of the menu hierarchy. If no parents are specifed for the entry, it will not appear on the screen. A maximum of five to ten types of parents may be specified. {_c_h_i_l_d_r_e_n, ...} Used with a _m_e_n_u or _i_t_e_m entry, specifies what menus or items are allowed to be children of the entry in the hierarchy. If no entries have _p_a_r_e_n_t fields which match, the entry will not appear on the screen. A maximum of five types of children may be specified. _c_a_l_l_b_a_c_k(),... Used with an _i_t_e_m entry, specifies a callback or callbacks to be called when the entry is selected. If no callbacks are specified, nothing will happen when the entry is selected. See CALLBACKS below. -h Used with a _m_e_n_u entry, specifies that this menu is to be displayed horizontally on the screen. -v Used with a _m_e_n_u entry, specifies that this menu is to be displayed vertically on the screen. This is the default. +-verify Used with an _i_t_e_m entry, specifies whether this item should or should not try to verify its selection by popping up a dialog box on the screen, which is the default. +-decmips Sun Release 4.1 Last change: Nov 16, 1990 7 DASH(1) USER COMMANDS DASH(1) +-rt +-vax Used with an _i_t_e_m entry, specifies that this item is or is not available specifically on decmips, rt, or vax workstation platforms. Default is + for all three platforms. If an _i_t_e_m is specified as not available for the platform on which _d_a_s_h is running, it will appear dimmed on the screen. CALLBACKS The following callbacks are available for binding to _i_t_e_m_s (see above). Arguments should be strings enclosed in double quotes. createTree(_t_r_e_e_n_a_m_e) Creates a tree of widgets named _t_r_e_e_n_a_m_e. createMapTree(_t_r_e_e_n_a_m_e) Creates a tree of widgets named _t_r_e_e_n_a_m_e if one does not already exist, or maps it if it does. destroyTree(_t_r_e_e_n_a_m_e) Destroys the first tree with name _t_r_e_e_n_a_m_e created by _c_r_e_a_t_e(_M_a_p)_T_r_e_e that it finds. quit() Causes _d_a_s_h to exit. toggleHelp(_l_a_b_e_l) Causes _d_a_s_h to toggle whether or not help entries are displayed, and to replace the label of the cal- ling item with _l_a_b_e_l. Entries which use this call- back must also specify -_v_e_r_i_f_y (see above). toggleVerify(_l_a_b_e_l) Causes _d_a_s_h to toggle whether or not callbacks for all items are verified with a popup dialog box, and to replace the label of the calling item with _l_a_b_e_l. Entries which use this callback must also specify -_v_e_r_i_f_y (see above). logout() Causes _d_a_s_h to log the user out. Sun Release 4.1 Last change: Nov 16, 1990 8 DASH(1) USER COMMANDS DASH(1) mapTree(_t_r_e_e_n_a_m_e) Causes the widget tree named _t_r_e_e_n_a_m_e created by _c_r_e_a_t_e_T_r_e_e to be visible on the screen. unmapTree(_t_r_e_e_n_a_m_e) Causes the widget tree named _t_r_e_e_n_a_m_e created by _c_r_e_a_t_e_T_r_e_e to disappear from the screen. printMenu() Causes _d_a_s_h to print out the current assembled menu hierarchy for the menu tree of which the calling entry is a member. Entries which use this callback must also specify -_v_e_r_i_f_y (see above). sh(_c_o_m_m_a_n_d) Causes _d_a_s_h to fork and execute a Bourne shell with the command line _c_o_m_m_a_n_d. See _s_h(1). exec(_c_o_m_m_a_n_d) Causes _d_a_s_h to fork and execute _c_o_m_m_a_n_d. In the string passed to exec, ~ will be interpreted from the HOME environment variable, and %M will be expanded to one of vax, rt, or decmips, as appropri- ate. cd(_d_i_r_e_c_t_o_r_y) Causes _d_a_s_h to make the working directory for the next _e_x_e_c callback _d_i_r_e_c_t_o_r_y. _D_i_r_e_c_t_o_r_y may contain %M. attach(_f_i_l_e_s_y_s_t_e_m) Causes _d_a_s_h to attach _f_i_l_e_s_y_s_t_e_m. See _a_t_t_a_c_h(1). add(_f_i_l_e_s_y_s_t_e_m) Causes _d_a_s_h to "add" _f_i_l_e_s_y_s_t_e_m, which means that _f_i_l_e_s_y_s_t_e_m is attached, and _f_i_l_e_s_y_s_t_e_m/%Mbin is added to the directory search path for the next _e_x_e_c callback. setup(_f_i_l_e_s_y_s_t_e_m) Causes _d_a_s_h to attach _f_i_l_e_s_y_s_t_e_m and set the environment variable SUBJECT to _f_i_l_e_s_y_s_t_e_m for the next _e_x_e_c call. To implement the equivalent of the _s_e_t_u_p command with this, try using something like: Sun Release 4.1 Last change: Nov 16, 1990 9 DASH(1) USER COMMANDS DASH(1) setup("16.00"),exec("xterm -n Todor") addMenus(_f_i_l_e_n_a_m_e) Causes _d_a_s_h to open _f_i_l_e_n_a_m_e and add its contents to the menu hierarchy of the calling item. Entries which use this callback must also specify -_v_e_r_i_f_y (see above). _F_i_l_e_n_a_m_e should have an entry specify- ing that the menu item responsible for loading it become -vax -rt -decmips, to prevent the user from trying to add it again. restart(_c_o_m_m_a_n_d) With no arguments, causes _d_a_s_h to reread its confi- guration and restart. With an argument, causes _d_a_s_h to exit and exec _c_o_m_m_a_n_d instead. _R_e_s_t_a_r_t may con- tain %M. EXAMPLES The file /usr/lib/X11/app-defaults/Dash provides perhaps the best known working examples of working _d_a_s_h configuration resources. In particular, the basic structure of trees and forms, not documented here, can be gleaned by examining the beginning of the file. The file /usr/athena/lib/Dash.menus contains an extensive listing good working menu format sample. The following sam- ple menu file demonstrates most of the features of the menu syntax as a user might wish to use to add to the Athena default: menu top: "top" {topthings} [NULL] +h; menu toys: "toys" [topthings/10] {toythings} ; menu work: "work" [topthings/10] {workthings} ; menu gnu: "GNU" [topthings/10] {gnuthings} ; item quit: "Quit" [topthings/15] quit() -verify ; item tetris: "tetris" [toythings] add("games"),exec("Tetris") ; item xchess: "chess" [toythings][gnuthings] add("gnu"),exec("xchess") ; item gdb: "debugger" [workthings][gnuthings] add("gnu"),exec("xterm -e gdb"); item emacs: "emacs" [workthings,gnuthings] exec("emacs") -verify; help tetris: "You'd better not have any work to do if you're going to play this thing."; help tetris: "Ignore previous warning -- PLAY!"; item xchess: -decmips; Sun Release 4.1 Last change: Nov 16, 1990 10 DASH(1) USER COMMANDS DASH(1) help quit: "Bye!"; FILES /usr/athena/dash dash /usr/lib/X11/app-defaults/Dash application defaults ~/.dashrc user defaults /usr/athena/lib/Dash.menus Athena default menus SEE ALSO X(1) BUGS Some things don't interpret "~" and "%M" that probably should. Quotes may not be passed in callback strings. Attempting to place menu bars other than at +0+0 causes the program to get confused when submenus try to go off the side of the screen. If the +_r_u_d_e option is used or the resource _r_u_d_e is set to false, the cursor isn't always set correctly for the menus. CUSTOMIZATION AND DOCUMENTATION A detailed document on using and customizing the Athena Dashboard is pending from Project Athena. It will explain the detailed subject of setting up complicated widget hierarchies. It may also include documentation of features that there was no time to include in this manual page. AUTHORS Craig Fields and Paul Boutin, MIT Project Athena Copyright (c) 1990 Massachusetts Institute of Technology Sun Release 4.1 Last change: Nov 16, 1990 11