Anyone who sorts this mess will get credit for it if they email me the sorted file. For now this is merely a compilation of data, none origional by jcpunk@uhacc.org /user/lib/menu/ /user/lib/menu/default /etc/menu ~/.menu Debian Menu System Chapter 6 The internals of the menu package 6.1 The update-menus program On startup, update-menus checks the file /var/run/update-menus.pid and the pid in it. If there's an update-menus process with that pid it kills it. If /var/lib/dpkg/lock exists, it forks to background and returns control to dpkg. The background process checks the /var/lib/dpkg/lock file approx. every second until the file's gone. After that, update-menus reads the menu-entry-files in the following directories:/etc/menu /usr/lib/menu /usr/lib/menu/default (if a user runs update-menus, it will add ~/.menu to the front of that list). For every menu entry line in each file it checks if the corresponding package is installed (works on file bases for old syntax menu entry files). The menu entries of all "installed" packages are added together in one big buffer that is kept in memory (exception: executable menu entry files are executed, and stdout is placed in the buffer). Once it's read all menu entry files, update-menus starts all executable scripts in /etc/menu-methods/, hands the scripts the previously created buffer via stdin. (If update-menus is ran by a user, it will first try to run the scripts in ~/.menu-methods, and only if that directory doesn't exist, it will run the scripts in /etc/menu-methods). Note that as an aid to debugging, one can create a simple script like #!/bin/sh cat > /tmp/menu-stdout and then view the file /tmp/menu-stdout to see exactly what update-menus handed the menu-methods on their stdin. This may also be usefull for people writing /etc/menu-method/* scripts: Running update-menus every time you changed something in the script may be quite time-consuming. So, it's much easier to install the above script in /etc/menu-methods/, run update-menus once, and then run /etc/menu-methods/mymethod < /tmp/menu-stdin (and, if that also takes too long, just try editing /tmp/menu-stdin, and removing 90% or so of all entries) 6.2 The install-menu program The files /etc/menu-methods/$wm are executable config files that start with the line #!/usr/sbin/install-menu and thus start that program, handing it the configuration file for the specific window manager in the first command line argument. This configuration consists of: 1. the compatibility mode ("menu-1" or "menu-2"). 2. where the various files should be stored/read. 3. what "needs" are supported, and what wrapper files should be used for each "type". See /usr/doc/menu/examples/ of the menu package for more comments. Options to install-menu: -v be verbose -d Produce loads of debugging output Some window managers don't support an `include' like statement in their system.*rc files (like m4 or cpp preprocessing), they cannot read the menudefs.hook file generated by install-menu from their system.*rc config file. To still be able to use them, install-menu will copy the file $path/$examplercfile to $path/$rcfile (with $examplercfile and $rcfile defined in the install-menu config file, and $path eighter the $rootprefix or ${HOME}/userprefix, depending on whether root or user executed the file.), and replace all occurrences of ``install-menu-defs'' with the $genmenu file it just generated. As an example, consider the following: examplercfile=system.foo-wm-example, rcfile=system.foo-wm, genmenu=menudefs.hook and rootprefix=/etc/X11/foo-wm. Now, if install-menu gets run, it will first generate the file /etc/X11/foo-wm/menudefs.hook. Next, it will line-by-line read the file /etc/X11/foo-wm/system.foo-wm-example and copy it's contents to /etc/X11/foo-wm/system.foo-wm, replacing every occurence of the string install-menu-defs by the contents of the file /etc/X11/foo-wm/menudefs.hook. To activate the file copying in this way, simply define the $examplercfile and $rcfile variables in the install-menu configuration file (for example, see /etc/menu-methods/fvwm), and make sure there is a $path/$examplercfile ($path being either $rootprefix, or $userprefix.) If you are wringing a menu method, you can use the following to debug it somewhat easier: 1. use the "cat" menu-method in /usr/doc/menu/examples/cat to create a list of menu entries in /tmp/menu-stdin (put it in ~/.menu-methods, and run update-menus), and then 2. you can run just your menu-method with (if it's called wm): ./wm -v < /tmp/menu-stdin (Use -v for verbose, -d for debugging, and you'll get loads of output!) 6.3 The install-menu config script definitions The menu-methods in /etc/menu-methods/* are basically made up of a lot of ``tag=string'' definitions, explaining install-menu how to generate a system.$wmrc script. This way you can tune the look of generated system.$wmrc to your needs. In the following, something like treewalk="c(m)" means that the treewalk variable by default has the value "c(m)". For examples of what these scripts can look like, see /usr/doc/menu/examples/*. compat="menu-1" Should always be "menu-1". Please, make this the first non-comment line in the script. supported endsupported Between the supported and endsupported keywords you define what "needs" are supported by this window manager. So, the following is an example for a wm that supports both needs=x11 and needs=text: supported x11=" ShowEntry(\"" $title "\", \"" $command "\")" text=" ShowEntry(\"" $title "\", \"" $command "xterm -T " $title " -e " $command "\")" endsupported For the variable substitution (and functions, not shown above), see the next paragraph. In the above example, you'll notice that for the menu entries that "need=text", an xterm is spawned for the command to run in. Also, as x11 is higher up in the supported list above than text, a package that supplies both a "needs=x11" and a "needs=text" entry will have the needs=x11 entry installed, in favour of the needs=text entry. You can continue lines on the next line with a \, but do make sure you don't add any spaces after the \. startmenu="" endmenu="" submenutitle="" These define what to print for the beginning/end of a menu, and how to the print a menu entry that pops up another menu entry. They are substituted the same way as the "supported" stuff is. (see next paragraph). treewalk="c(m)" This string defines in what order to dump the $startmenu, $endmenu, and $submenutitle (and its children). Each char in the string refers to: c : dump children of menu. m : dump this menu's $submenutitles ( : dump $startmenu ) : dump $endmenu M : dump all $submenutitles of this menu and this menu's children. The default is "c(m)". For olvwm, one needs: "(M)" genmenu="" The menu file to generate (usually something like system."$wm"rc). The file itself may depend on the level or title that is currently being worked on, like genmenu="/subdir/" replacewith($section," ","_") "/rc.menu" (Substitution works just like in the supported stuff, see above). Note that the files made this way are truncated upon opening, so if you have a genmenu like the example above, then your endmenu= will override the startmenu stuff (but you probably only need one of the two anyway). rootsection="/Debian" the prefix, every $section variable gets. prerun="" postrun="" The commands to run before resp. after the actual generation of the menudefs.hook (genmenu) file. Commands will be executed by sh. Example: prerun="rm -rf " prefix() "/*" postrun="killall -USR1 fvwm2" (Substitution works just like the supported stuff, see below). preruntest="" Just like prerun, but if the return value of the command is non-zero, menu will quit. onlyrunasroot=false onlyrunasuser=false If onlyrunasroot is set to true, menu will quit silently when run as user. Simmilarly for onlyrunasuser. preoutput="#Automatically generated file. Do not edit (see /usr/doc/menu/html)\n\n" postoutput="" Text to put at the beginning resp. end of the generated file ($genmenu). command="" A command to run instead of install-menus. This command used to be needed to get around limitiations due to compatibilty stuff. But that compatibility with pre menu-1 stuff has been dropped, and isn't needed any more. Example: command="cat > /tmp/menu-stdin" hotkeyexclude="" Keys not to use for hotkey generation. You can use the same variables and functions here as in for example the startmenu sections. Example: hotkeyexclude="q" $section hotkeycase="insensitive" can be either "insensitive" or "sensitive". Determines whether the hotkeys can be of mixed case (fvwm2 reads the hotkeys case-insensitive, pdmenu case-sensitive). In case of the titles "Xa" and "xb", hotkey case-insensitive will generate "X" and "b", whereas case-sensitive would generate "X" and "x". sort=$title Entries within one menu will be alphabetically sorted by whatever sort returns. So, if you do sort=ifelse($command, "1", "0"):$title, then all submenus will appear above the commands in a submenu. (A submenu always has $command="") rcfile="" If the window manager doesn't support an "include filename" or "read(filename)" statement in it's config file, you can rename the wm's config file to system."$wm"rc-menu, and insert a "install-menu-defs" line (without the quotes, or whitespace around it, and "install-menu-defs" must be the only thing on the line) in the system."$wm"rc-menu file. This will then get replaced by the $genmenu file that was just created (see also $examplercfile). examplercfile="" if needed (see rcfile), this is the system.rc"$wm"-menu file. In that case, make rcfile=system.rc"$wm". rootprefix="" The prefix to use when running as root (applies to $genmenu, $rcfile, $examplercfile and other old cache files) userprefix="" see rootprefix, but when running as user. repeat_lang="" If set to "LOCALE", then menu will automatically translate all title's to the languages specified by the current LC_LOCALE setting. (LC_ALL, ...). It is intended to expand this to repeat_lang="en:es:eo:nl", which would repeatedly run install-menus for the various specified languages. But the latter hasn't yet been implemented. hint_optimize=false If set to true, menu will try to generate an `optimal' tree, using the variables below. If set to false, menu will keep the sections as they are specified in the menu entry files (and ignore any hint stuff). hint_nentry=6 Optimal number of entries in a submenu. It's a float, so you can set it to 5.5 if you cannot decide between 5 and 6. Also, values less than 3 probably don't work very well at the moment. hint_topnentry=5 Same as hint_nentry, but for the top level menu. Often here are other entries, added by the Window Manager itself (like Exit, Xterm, whatever) that menu doesn't know about, so that you may want to instruct menu to put less entries in the top level menu. hint_mixedpenalty=15.0 Penalty for `mixed' menus. Mixed menus are those with both submenus and direct commands in them. hint_minhintfreq=0.1 Minimal relative frequency for the hints before they are considered. Internal variable to speed up the tree generation. If you find menu slow, increase this value (to, say 0.2 or 0.3). hint_mlpenalty=2000 `max local penalty', while evaluating the possible trees, menu gives `penalties' for submenus that don't contain the desired number of submenus. The penalty is sqrt(n_entry_opt-n_entry), and eventually will be calculated as a sum of all nodes. But to speed things up, menu will discard possibilities in which any node has a `local' penalty of more than hint_mlpenalty. Increase this value if you think menu is overlooking your favorate tree (also decrease minhintfreq), decrease this value if you think menu is waisting too much time. Because of hint_max_ntry, the influence of this variable is nearly zero nowadays. hint_max_ntry=4 menu will recursively, for each node, try the hint_max_ntry best local menu-divisions. hints_max_iter_hint=5 The search for what hints to use in one menu is rather expensive. But due to the way things are sorted, menu seems to always find the `best' match in the first 2% of iterations. Thus, a way to speedup things is simply to cutt of menu searching after `some' iterations are done. This value controls this, and limits the number of iterations to 5+hint_max_iter_hint*number_of_possible_hints. Set this value to negative to disable this. hint_debug=false Set to true if you want to see loads and loads of debug output. 6.4 Hints, tree optimization The hints actually work in a rather strange way: when hint_optimize=true then all $section elements are added to the specified $hints variable, and the order (/Apps/Editors or /Editors/Apps) of the resulting hints is completely ignored. Then, the hints for each menu entry are handed to the optimization routine, that will calculate a reasonable tree for those hints. That tree must comply with the following: When a user looks for a program "Program" with, say, hints "Good,Bulky,Heaven", then, while walking through the tree, it should at every node vizited be clear for the user what submenu to select (or the menu should have "Program" directly in it). So, the toplevel menu may look like Good Hell Microsoft because then a searcher for a menu entry with hints "Good,Bulky,Heaven" will know to select the submenu "Good". The toplevel menu may not look like Good Hell Heaven as now it isn't clear whether to vizit the Good or the Heaven submenu. That rule allows usually for many different trees, and the task of the optimization procedure is to select, in a finite amount of time, the tree that best matches the user's desire obout the optimimum number of menu entries. 6.5 Variables and functions in the install-menu scripts The supported "needs" definitions and "startmenu=", "endmenu=" and "submenutitle=" are interpreted as follows: String constants: Anything inside double quotes ("") is interpreted as a string, and is written verbatim to the output file. Stuff like \n, \t, ... will be substituted for their C expansions (But not \0xx, currently). Variables: Anything matching $[a-z,A-Z,_]* is interpreted as a variable, and the corresponding definition from the menu entry is substituted. Special variables: The following variables are treated in a special way by install-menus, either because they are used for other purposes too, or because they are modified by install-menus (the ones marked with a "!" are modified by install-menus). needs: used to determine whether the window manager supports this menu entry. command: If this is undefined, this menu entry is taken as defining a sub-menu. (this way you can specify icons of sub-menus). title!: Used for sorting (see section). For sub-menu entries (those with empty command), this is initialised to the last part of the section. Please, keep the title short (two words at maximum). The title is for people who already know what programme they want to start. See "longtitle" and "description" below for longer descriptions. sort: used for sorting (see section). To make sure an entry is at the beginning, use something with a low ASCII number, like "$". For sorting at the end, use "|" section!:Used to determine the section of the menu entry. The menu entries that have a empty $command, ie those that define a submenu, have $title added to the end of $section The menu entries that have a non-empty $command have their $section modified to $section/$title, or $section/$sort:$title if $sort is defined. The menu entries within one submenu are sorted according to $section. hotkey!: Modified to reflect what install-menus thinks is the most suitable hotkey for this menu entry. The hotkey= in the menu entry file is taken as a suggestion, that could be overwritten if there is another entry with the same hotkey=. To suggest two possible hotkeys for an entry use hotkey="ab", with "a" being the most preferred hotkey. Preferred variables: The following aren't special for install-menus, but it's nice (read: essential) to use the same variables for the same things. So, I'll suggest some here. If you want to invent new ones, please do so and mail them to me so that I can include them here. icon: The location of the iconfile for this menu entry. If you don't have an iconfile, just leave out the icon= in the menu entry. longtitle: For people that like descriptive titles (about one line) It is probably best to include this in your menu entries, while the window-managers don't (by default) put it in the menus. That way, people who want descriptive titles can turn them on, but others don't need to use them. description:An even longer description (about 5 lines). For example, a description of the documentation in the dwww generated html pages. Suggested variables: The following variables probably shouldn't appear often (or at all) in the menu files supplied with packages. They are mostly intended for use by local system managers. Nevertheless, it is advised that all debian systems use the following variable names: visable: Some apps add entries to utmp the utmp file, so that "who" and friends know they are running (this is especially true for xterms etc). If $visable set (to anything other than "" or "none"), xterms etc will not write logging info to utmp. (may not work for your window manager). geometry: For X apps, this will be the size of the (main) window that will be created (units in either chars or pixels, depending on type of main window (xterm or graphic)). If you as package maintainer want to use this, you should probably think about setting this variable somewhere in an Xresources file. Functions: Anything matching [a-z,A-Z,_] is taken as a function (and an error is generated if the function doesn't exist). The arguments of the functions can be other functions, string constants or variables. prefix() returns the current prefix dir: either $rootprefix, or $HOME/$userprefix, depending on who runs install-menu ifroot($rootarg, $userarg) if(getuid()==0) print $rootarg, else print $userarg print($arg) Same as just $arg; if $arg is empty, generate an error. nstring($n, $string) write $string $n times. So, nstring(3,"Aa") writes "AaAaAa". (Useful in combination with level()). esc($arg1,$arg2) Print $arg1, but escape all occurrences of characters in $arg2 with a \. (thus, if arg1="hello", arg2="lo", print "he\l\l\o"). escwith($arg1, $arg2, $arg3) Same as esc, but use $arg3 as escape sequence. escfirst($arg1, $arg2, $arg3) Same as escwith, but only escapes thirst occurrence of $arg2. cppesc($arg1) Escape anything that isn't a letter, number or _ with $. So, for example, a '-' is replaced by '$2D'. This way, $arg1 can be used as a #define in cpp. tolower($arg) toupper($arg) Returns the argument set in lowercases resp uppercases. replacewith($s, $replace, $with) Search s for occurrences of characters from string replace, and replace them by the corresponding character in $with. Example: replacewith_string("hello $world, %dir", "$% ", "123") returns: "hello31world,32dir" ifempty($arg1, $arg2) If $arg1 is empty, print $arg2, otherwise print nothing. For compatibility, $arg1="none" is interpreted as empty. ifnempty($arg1, $arg2) If $arg1 is not empty, print $arg2. For compatibility, the string "none" is seen as empty. ifelse($arg1,$arg2,$arg3) If $arg1 is non-empty, print $arg2, otherwise $arg3. For compatibility, the string "none" is seen as empty. ifeq($arg1, $arg2, $arg3) If ($arg1==$arg2) then print $arg3 ifneq($arg1, $arg2, $arg3) If ($arg1!=$arg2) then print $arg3 ifeqelse($arg1, $arg2, $arg3, $arg4) If ($arg1==$arg2) then print $arg3 else print $arg4 cond_surr($arg1, $arg2, $arg3) If $arg1 is non-empty print $arg2$arg1$arg3, otherwise print nothing. For compatibilty, $arg1="none" is interpreted as empty. iffile($arg1, $arg2) If file $arg1 exists, and can be opened for reading by whoever started the current process, return $arg2, otherwise return nothing. ifelsefile($arg1, $arg2, $arg3) If file $arg1 exists, and can be opened for reading by whoever started the current process, return $arg2, otherwise return $arg3. catfile($arg1) Return the contents of file $arg1. forall($array, "var", $exec) For each element of the colum separated array $array, set $var to that element, and print $exec. Example: forall("eo:nl", "lang", " name[" $lang "]=\"" translate(title()) "\"\n") will print: name[eo]="Mi estas titolo" name[nl]="Ik ben een titel" parent($arg) for $arg a "directory", return parent directory: parent("/Debian/Apps/Editors") = "/Debian/Apps". basename($arg) return the last part of the parent directory: basename("/Debian/Apps/Editors") = "Apps". stripdir($arg) everything after the last slash, i.e. what basename() should have returned: stripdir("/Debian/Apps/Editors") = "Editors". entrycount() the number of entries in this menu. entryindex() returns relative position of this entry. Start with 0, last entry is entrycount() - 1. BUG: if sort= anything other than $title, then this entryindex() will return incorrect values. firstentry($arg) return $arg if this is the first entry of this menu (that is, entryindex() = 0). Else, return nothing. lastentry() return $arg if this is the last entry in this menu (that is, entryindex() = entrycount() -1). Else, return nothing. level() return nesting of this menu in the total menu tree. add($arg1,$arg2) sub($arg1,$arg2) mult($arg1,$arg2) div($arg1,$arg2) returns the sum, difference, product or quotient of $arg1 and $arg2. Note that the arguments are strings, that are converted to integers. example: mult("24", entryindex()) rcfile() examplercfile() mainmenutitle() rootsection() rootprefix() userprefix() treewalk() postoutput() preoutput() These functions all output whatever they were defined to be in the menu-method file. translate($lang, $text) translate $text into $lang. example: translate("eo", "Apps") prints: Aplikoj String constants, variables and functions can be concatenated by placing them after each other with a space in between, like: "hello" ifelse($comma, $comma, " sorry" $period " comma not defined") " world" If I understand your question, it's not about keybindings, but about creating your own apps root menu for Windowmaker. I do this with the following as ~/GNUStep/WMRootMenu, which shows a number of my own hotkey bindings. It also shows the use of an interactive query (the '%a' directive) to prompt for information before opening an application. Note that Debian's menus are still accessed under the "Debian Menus" link, by invoking: ("Debian menus", OPEN_MENU, "/etc/X11/WindowMaker/menu.hook"), ...you could configure your own menus to your liking, then addd this action, and you'd have the best of both worlds: your own menus, but Debian menus for stuff that's actually on your system, automatically updated for you. ~/GNUstep/Defaults/WMRootMenu ( Commands, (Run..., SHORTCUT, "Mod1+F2", EXEC, "%a(Run, Command to run:)"), (Terminal, SHORTCUT, "Shift+Mod1+t", EXEC, rxvt), ( Rootshell, SHORTCUT, "Shift+Mod1+r", EXEC, "rxvt -bg grey20 -fg wheat -exec sudo su -" ) ) You can now use WPrefs.app ( its appicon looks like a heart rate meter with a GNUStep icon backgroud ). Note that this will replace any oldstyle menus and there is no way to convert the oldstyle menu to the new libproplist style menu. For old style menus, edit the file ~/GNUstep/Library/WindowMaker/menu and save your changes. Window Maker should detect the change and automatically update. If you are having a problem getting it to reload the menu, try touch menu to force the modification time into the future. How do I add dynamic items to my root menu? A few programs are floating about, notably wkdemenu.pl that can produce output from other menu styles. In order to get WindowMaker to launch the process everytime you want to use the menu, use something like ("External Menu", OPEN_MENU, "| bob.sh") in a proplist style menu. You can tell if you have a proplist style menu if you can edit it with WPrefs. You can do this directly in WPrefs by going to the menu editor, adding an "external menu", and then clicking the "ask guru button" and filling in the process name. How do I launch multiple instances of XTerm from one appicon? The easiest way to accomplish this is to dock XTerm as normal. Then Go to the Attributes menu -> Application Specific and select no application icon for XTerm. Then right-click on the docked appicon and select settings. Change the Application Path with arguments section to '/bin/sh -c "exec xterm &"' How do I dock an arbitrary console application like mutt? There are two key things to do if you want a program (such as mutt) to be able to start in a terminal window from the Dock or the Clip: (1) Make the terminal window start the program you want to run instead of a shell. Both xterm and rxvt (and its descendants) are capable of doing this. For example: xterm -e mutt rxvt -e mutt gnome-terminal -e mutt (2) Convince Window Maker that the resulting terminal window is not a regular terminal window, but rather some other program instance. Both xterm and rxvt are also capable of doing this. Make sure that -e is the last command option. For example: xterm -name muttTerm -e mutt rxvt -name muttTerm -e mutt gnome-terminal --name=muttTerm -e mutt This causes the instance of the terminal window that you start to have an . pair of `muttTerm.XTerm' (usually rxvt's class is also XTerm; don't know about its descendants, such as wterm and Eterm). Do not use spaces or periods in the instance name. For example, these are BAD instance names: xterm -name mutt.term -e mutt rxvt -name 'mutt term' -e mutt Window Maker will not like you if you use them. With a different instance name, you can now do the following: - Dock the resulting appicon in the dock, or clip it to the Clip. - Assign a different icon and different window properties to the `special' terminal window running your program (make sure you choose the exact `muttTerm.XTerm' window specification in the Attributes editor). - Specify different resource settings for muttTerm in your ~/.Xdefaults file (e.g., different default foreground and background colors). There are a few other non-key things you can do to complete the process: (3) Tell the terminal window to display a more meaningful or prettier title and icon title than what gets put there due to `-e'. For example: rxvt -title 'Mail (mutt)' -n 'Mail' -name muttTerm -e mutt Xterm works the same way. (4) These are getting to be a lot of command-line options. Make a wrapper script to use so you don't have to remember them all: mkdir ~/bin cat >~/bin/muttTerm < etc/GNUstep/Defaults ./Backgrounds ./Icons XXX: Make it the _Only _One_ Icon-Archiv for all your desktops ( I use a link '/IconX' in the root-dir for quick access ) ================= /usr/share/doc/WindowMaker/Debian.README Sources for documentation ----------------------------------------- XXX : The Window Maker manual written by Alfredo Kojima ftp://ftp.windowmaker.org/pub/wmaker/docs/ Please note the manual documents version 0.10.x of Window Maker, and many features/changes have occured since then. To find out what has changed, please read file:/usr/doc/wmaker/NEWS.gz and file:/usr/doc/wmaker/changelog.gz. A new version of this manual is being developed. If you want to contribute to the manual please contact wm-user@windowmaker.org * The Window Maker web site http://www.windowmaker.org/ You can find all sorts of information here. It's kept very up to date. * The Window Maker mailing list http://www.windowmaker.org/lists.html There's a Window Maker mailing list. There you can ask questions about Window Maker and *related* applications (s/n is _way_ low nowadays due to unrelated discussions). Please read the archives before asking! * The Window Maker FAQ http://www.dpo.uab.edu/~grapeape/wmfaq.html This is NOT file:/usr/doc/wmaker/FAQ.gz, but another document. It contains information about several aspects of Window Maker that are not covered on the FAQ included alongside with this Readme. * The Window Maker Configuration documents ftp://ftp.windowmaker.org/pub/wmaker/docs/WindowMaker-*-Config.txt.gz This documents the files found on ~/GNUstep/Defaults/. It's kept as up to date as possible. IF YOU ARE UPGRADING FROM 0.17.5 or earlier ------------------------------------------- PLEASE NOTE: WPrefs is a work in progress. SAVE YOUR CONFIGURATION. READ THE READMEs. XXX Please note that WPrefs' Menu Guru REQUIERES a menu in "Property List" format to work properly. It's very likely that you have an old format menu. There's a script called wm-oldmenu2new alongside this file that converts your menu to the new format. It's a hack, it won't be installed anywhere else. XXX Debian specific notes --------------------- Please note that the /usr/X11R6/include/X11/pixmaps is not going to be supported in future releases. Other Window Maker packages should put pixmaps in /usr/share/WindowMaker/Pixmaps and icons in /usr/share/WindowMaker/Icons, ONLY. The structure Window Maker tries to use is like this: GNUstep +.AppInfo +Defaults +Library +WindowMaker + Backgrounds [*] + IconSets [*] + Pixmaps + Sounds + Styles [*] + Themes [*] +Icons Please note Icons are not considered Window Maker-only resources. [*] these directories are OPEN_MENU'ed WITH the right application. That means you can put the *file* "Great Debian Theme" on Themes, it will show up in the menu, and will be opened using setstyle, which installs it, i.e., sets that theme as the current theme. If you don't like the arrangement of the Appearance menu, you can put a file "appearance.menu" in ~/GNUstep/Library/WindowMaker, and it will override the default one. Look at /etc/X11/WindowMaker/appearance.menu for an example. XXX Shortcuts ------------------------------------ Thanks to a suggestion, there's support for Shortcuts. If you want to have Shift F1 launch an XTerm, you can: $ cp /usr/lib/menu/xterm /etc/menu $ sensible-editor /etc/menu/xterm add: shortcut=Shift+F1 and run update-menus. Changing the menus (or "WPrefs segfaults when I click the cute menu icon") -------------------------------------------------------------------------- XXX: Very important ! First of all, I have this urge to say that it doesn't segfault for me. It gives me a nice warning about being unable to use my current menu. The problem is that wmaker now is capable of using a new type of menu, namely a PropList menu. It looks something like this: ( Applications, (Debian, OPEN_MENU, menu.hook), ( WorkSpace, (Appearance, OPEN_MENU, appearance.menu), (Workspaces, WORKSPACE_MENU), ("Arrange Icons", ARRANGE_ICONS), ("Hide Others", HIDE_OTHERS), ("Show All Windows", SHOW_ALL), ("Clear Session", CLEAR_SESSION), ("Save Session", EXEC, "") ), (About..., INFO_PANEL), (Exit, SHUTDOWN) ) That cute looking menu button (let's call it by its name: the Menu Guru) in WPrefs expects to find a menu in this format. I considered changing the menu-method to something that spits out a menu in this format (it's quite easy) but there's a little tiny problem: see that line that reads "OPEN_MENU" in the example above... well, it happens that appearance.menu has to be in the old format. That means that if I make the menu method produce a new style menu, that menu has to be the root menu. And that is not a good idea (the reason is left as an exercise to the reader, take into account the people that aren't using menu.hook as the root menu in the first place). Still want to use WPrefs to edit you menu? Cut and paste the example above into ~/GNUstep/Defaults/WMRootMenu, start WPrefs, click the Menu Guru (the 9th icon, left to right). Now go read the docs. That's the reason they are there. Marcelo E. Magallon , Thr, 1 Apr 1999 18:47:30 -0600 ================ My /etc/menu/local.windowmaker ?package(local.wmaker): needs=wmaker \ section="AAA_local" title="Run..." sort=$ \ command="SHEXEC" arg="%a(Run,Type command to run:)"\ shortcut=Control+Mod1+R ?package(local.wmaker):needs=wmaker \ section="AAA_local" title="Preferences" \ command="EXEC" arg="WPrefs" ?package(local.wmaker):needs=wmaker \ section="AAA_local" title="Restart" sort=$ \ command="RESTART" ?package(local.wmaker):needs=wmaker \ section="AAA_local" title="Save Session" \ command="SAVE_SESSION" ?package(local.wmaker):needs=wmaker \ section="AAA_local" title="Exit" sort=$ \ command="EXIT"\ shortcut=Control+Mod1+Escape ======================= /etc/X11/WindowMaker/menu Look for 'XXX' I used as marker for interesting points :-) The root-menu is the main-menu you get with right mouse button /* * Root Menu definition for WindowMaker * * Syntax is: * * [SHORTCUT <Shortcut>] <Command> <Parameters> * * <Title> is any string to be used as title. Must be enclosed with " if it * has spaces XXX: * SHORTCUT specifies a shortcut for that item. <Shortcut> has the * same syntax of the shortcuts key options in the * $HOME/GNUstep/Defaults/WindowMaker file, such as RootMenuKey or MiniaturizeKey. * * You can't specify a shortcut for a MENU or OPEN_MENU entry. * * <Command> one of the valid commands: * MENU - starts (sub)menu definition * END - end (sub)menu definition * OPEN_MENU - opens a menu from a file, pipe or directory(ies) contents * and eventually precede each with a command. * WORKSPACE_MENU - adds a submenu for workspace operations. Only one * workspace_menu is allowed. * EXEC <program> - executes an external program * SHEXEC <command> - executes a shell command (like gimp > /dev/null) * EXIT - exits the window manager * RESTART [<window manager>] - restarts WindowMaker or start another * window manager * REFRESH - refreshes the desktop * ARRANGE_ICONS - rearranges the icons on the workspace * SHUTDOWN - kills all clients (and close the X window session) * SHOW_ALL - unhides all windows on workspace * HIDE_OTHERS - hides all windows on the workspace, except the * focused one (or the last one that received focus) * SAVE_SESSION - saves the current state of the desktop, which include * all running applications, all their hints (geometry, * position on screen, workspace they live on, the dock * or clip from where they were launched, and * if minimized, shaded or hidden. Also saves the current * workspace the user is on. All will be restored on every * start of windowmaker until another SAVE_SESSION or * CLEAR_SESSION is used. If SaveSessionOnExit = Yes; in * WindowMaker domain file, then saving is automatically * done on every windowmaker exit, overwriting any * SAVE_SESSION or CLEAR_SESSION (see below). * CLEAR_SESSION - clears any previous saved session. This will not have * any effect if SaveSessionOnExit is True. * INFO - shows the Info Panel * * OPEN_MENU syntax: * 1. File menu handling. * // opens file.menu which must contain a valid menu file and inserts * // it in current position * OPEN_MENU file.menu * 2. Pipe menu handling. * // opens command and uses it's stdout to construct menu. * // Command's output must be a valid menu description. * // The space between '|' and command itself is optional. * // Use '||' instead of '|' if you want the menu to always update * // when opened. It might be slow. * OPEN_MENU | command * OPEN_MENU || command * 3. Directory handling. * // Opens one or more directories and construct a menu with all * // the subdirectories and executable files in them sorted * // alphabetically. * OPEN_MENU /some/dir [/some/other/dir ...] * 4. Directory handling with command. * // Opens one or more directories and construct menu with all * // subdirectories and readable files in them sorted alphabetically, * // preceding each of them with command. * OPEN_MENU [options] /some/dir [/some/other/dir ...] WITH command -options * Options: * -noext strip whatever is after the last dot in the * file name * * <Parameters> is the program to execute. * * ** Options for command line in EXEC: * %s - substitute with current selection * %a(title[,prompt]) - opens a input box with the specified title and the * optional prompt and do substitution with what you typed * %w - substitute with XID for the current focused window * %W - substitute with the number of the current workspace * * You can override special characters (as % and ") with the \ character: * ex: xterm -T "\"Hello World\"" * * You can also use character escapes, like \n * * Each MENU statement must have one mathching END statement at the end. * * Example: * * "Test" MENU * "XTerm" EXEC xterm * // creates a submenu with the contents of /usr/openwin/bin * "XView apps" OPEN_MENU "/usr/openwin/bin" * // some X11 apps in different directories * "X11 apps" OPEN_MENU /usr/X11/bin $HOME/bin/X11 * // set some background images * "Background" OPEN_MENU -noext $HOME/images /usr/share/images WITH wmsetbg -u -t * // inserts the style.menu in this entry * "Style" OPEN_MENU style.menu * "Test" END */