FVWM-MENU-DIRECTORY(1)

πŸ’– FVWM-MENU-DIRECTORY πŸ’–

okay bestie, welcome to fvwm-menu-directory(1) β€” yes that's the manual page name, section 1, we love a classic ✨

It builds a directory browsing menu for fvwm, and it is literally the moment.


🌸 NAME 🌸

fvwm-menu-directory β€” builds a directory browsing menu for fvwm πŸ—‚οΈ


πŸŽ€ SYNOPSIS πŸŽ€

fvwm-menu-directory [ --help|-h|-? ] [ --version|-V ] [ --name|-na NAME
] [ --title|-t NAME ] [ --item|-it NAME ] [ --icon-title|-icon-t XPM ] [
--icon-dir|-icon-d XPM ] [ --icon-file|-icon-f XPM ] [
--icon-app|-icon-a XPM ] [ --wm-icons ] [ --dir|-d NAME ] [ --order|-o
NUM ] [ --[no]all|-a ] [ --[no]links|-l ] [ --xterm|-x CMD ] [
--exec-title|-exec-t CMD ] [ --exec-file|-exec-f CMD ] [
--exec-app|-exec-a [CMD] ] [ --command-title|-command-t CMD ] [
--command-file|-command-f CMD ] [ --command-app|-command-a CMD ] [
--[no]reuse|-r ] [ --[no]check-subdirs|-ch ] [ --special-dirs|-s [VALUE]
] [ --[no]memory-for-speed|-mem ] [ --menu-style|-men NAME ] [
--func-name|-f NAME ]

πŸ¦‹ DESCRIPTION πŸ¦‹

So it's a perl script πŸ’… and what it does is spit out output that you read in with PipeRead, so you can build an fvwm menu that has a whole directory listing inside it. And the best part? Almost everything can be configured. Periodt. πŸ’–


✨ HINTS ✨

The title item comes with its own attached action, and usually it gets added to the menu. That's your moment to define an action for the directory the menu is being built for β€” like, say, opening a terminal in that directory (which is the default, btw 🫢).

But ngl, this can annoy some users. So if you want to kill the title action, hit it with --command-title "", and if you want the title gone entirely, that's --title "". πŸ™ˆ


πŸ’… OPTIONS πŸ’…

  • --help β€” show the usage and dip. πŸ‘‹
  • --version β€” show version and dip.
  • --name name β€” menu name, only used with --reuse, default is MenuBrowser.
  • --title title β€” menu title format, default is '%*-40p' β€” that's the last 40 characters of the current full path. TAB can be written as '\t', but heads up: in .fvwm2rc you gotta write a double backslash or an actual real TAB. 😀

Format specifiers: %d β€” the current directory name; %p β€” the current directory full path.

These specifiers can receive an optional integer size, positive for right adjusted string or negative for left adjusted, example: %8x; and optional *num or *-num, which means to leave only the first or last (if minus) num of chars. The num must be greater than 3, since the striped part is replaced with ..., example: %*30x. Both can be combined: %-10*-20x, which instructs to get only the 20 last characters, but if the length is less then 10 β€” to fill with up to 10 spaces on the right. Slay. πŸ’…

  • --item format β€” menu item format, default is '%n'. TAB and width modifiers for %n, %N and %s can be specified as described in --title above. Note: specifying a non default format slows the script. 🐒

Format specifiers:

%n - file/dir name (without the path)
%N - file/dir name (full with the path)
%d - file/dir date (yyyy-mm-dd HH:MM:SS)
%D - file/dir date (yyyy-mm-dd)
%s - file/dir size (in bytes)
%t - file/dir type (File|Dir |Link|Sock|Blck|Char|Pipe)
%T - file/dir type (F|D|L|S|B|C|P)

Example:

--title '%*-40p\tDate, Type\tSize' --item '%*40n\t%d %t\t%s'
  • --icon-title icon β€” menu title icon, default is none.
  • --icon-dir icon β€” menu dir icon, default is none.
  • --icon-file icon β€” menu file icon, default is none.
  • --icon-app icon β€” menu application icon, default is none.
  • --wm-icons β€” define icon names suitable for use with the wm-icons package. Currently this is equivalent to: --icon-title menu/folder-open.xpm --icon-item menu/file.xpm --icon-dir menu/folder.xpm --icon-app menu/utility.xpm.
  • --dir dir β€” starting dir, default is ${HOME-.}.
  • --order number β€” in the range (-6 .. 6), default is 5:
    1. do not sort
    2. dirs first
    3. files first
    4. sort by name
    5. dirs first
    6. files first

A negative number represents reverse order. πŸ”„

  • --[no]all β€” show hidden files, like in 'ls -A', default is --noall.
  • --[no]links β€” follow linked directories, default is --nolinks.
  • --xterm command β€” X terminal call, default is 'xterm -e'.
  • --exec-title command β€” an fvwm Exec command on directory title (usually the shell), default is ${SHELL-/bin/sh}. '-' means no Exec command, i.e. Nop. If the command is not started with '^' the X terminal call is prepended. The command is started in the currently browsed directory. πŸ“‚
  • --exec-file command β€” an fvwm Exec command on regular files, default is ${EDITOR-vi}. '-' means no Exec command, i.e. Nop. If the command is not started with '^' the X terminal call is prepended. The actual file name is appended to the command.
  • --exec-app [command] β€” an fvwm Exec command on +x files, default is '-', which means the same command as on regular files. If no command is given, it is assumed to be empty β€” simply run the +x file. If the command is not started with '^' the X terminal call is prepended. The actual file name is appended to the command.
  • --command-title command β€” an fvwm command to execute on title. If this option is not given (or command is '-'), the --exec-title is used instead. In the command, %d is substituted with the full directory path.

In fact, --exec-title=tcsh is equivalent to --command-title='Exec cd %d; xterm -e tcsh'.

The empty value disables the title action. 🚫

  • --command-file command β€” an fvwm command to execute on regular files. If this option is not given (or command is '-'), the --exec-file is used instead. In the command, %f is substituted with the full file path.

In fact, --exec-file=vi is equivalent to --command-file='Exec xterm -e vi %f'.

  • --command-app command β€” an fvwm command to execute on x files. If this option is not given (or command is '-'), the --command-app is used instead. In the command, %f+ is substituted with the full file path.

In fact, --exec-app=^exec is equivalent to --command-app='Exec exec %f'.

  • --[no]reuse β€” no pop-up menus, reuse the same menu, default is --noreuse. When you specify this option the Menu action is used, not Popup. Also, the --name parameter is not ignored, and the --dir parameter is ignored if there is a ~/.fvwm/.fvwm-menu-directory.dir file. This file is only created or used with this option specified β€” it is the only solution for the current fvwm menu state. πŸ‘‘
  • --[no]check-subdirs β€” check all subdirs for having execute (+x) permission and replace "Popup"/"Menu" command with Nop for these without permissions. This has a visual effect of disabling the popup triangle in the subdirectory item. The default is --nocheck-subdirs, because: 1) enabling this slows a bit the script, 2) with this option enabled, if no icons used and no dir/file separate sorting used there is no way to know that the item is directory and not file. 😭
  • --special-dirs value β€” add .. or ~ or / special directories according to given optional value. Without this option these directories are not added. Default value if not specified is "1,2". The value is comma separated ordered special directory indexes, where 1 is parent directory, 2 is home directory, 3 is root directory. If minus is prepended to the value, special directories are added at the bottom of the menu instead of top. Value 0 or any bad value is equivalent to non-specifying this option at all.
  • --[no]memory-for-speed β€” use speed optimization, i.e. use previously created directory menus without destroying it when closed, default is --nomemory-for-speed.
⚠️ Warning: speed optimization takes up a lot of memory that is never freed again while fvwm is running. πŸ’€
  • --menu-style name β€” assign MenuStyle name to the menus.
  • --func-name name β€” overwrite the default MissingSubmenuFunction name that is FuncFvwmMenuDirectory.

Option parameters can be specified either using '=' or in the next argument. Short options are ok if not ambiguous: -a, -x, -icon-f; but be careful with short options, what is now unambiguous, can become ambiguous in the next versions. πŸ™ˆ


🌈 USAGE 🌈

Put this into your fvwm configuration file to invoke the script:

AddToFunc FuncFvwmMenuDirectory
+ I PipeRead "fvwm-menu-directory -d $0"

More complex example:

AddToFunc FuncFvwmMenuDirectory
+ I PipeRead "fvwm-menu-directory -d '$0' -x 'Eterm -g 80x40 -e' \\
    -a -l -o 6 --exec-app --exec-title 'tcsh -l' \\
    --exec-file 'vim -R' -t 'Go to: %d' --wm-icons"

And put this in the menu from which you want to pop-up the directory menus:

AddToMenu SomeMenu MissingSubmenuFunction FuncFvwmMenuDirectory
+ "Home Directory" Popup $[HOME]
+ "Httpd Directory" Popup /home/httpd

Note: please use absolute path names. πŸ“Œ

It is a good idea to set the menu pop-up delay to something positive and enable busy cursor:

MenuStyle * PopupDelayed, PopupDelay 200
BusyCursor DynamicMenu True

in your configuration file when using this script for better results.

Another interesting usage (--reuse or -r is mandatory for this):

AddToMenu Browser
+ DynamicPopupAction PipeRead \\
  "fvwm-menu-directory -r -na Browser -d / -s"
AddToMenu SomeMenu "My Browser" Menu Browser

Here the --dir parameter (starting directory) is ignored if there is a ~/.fvwm/.fvwm-menu-directory.dir file, which you can delete. πŸ—‘οΈ


πŸ‘‘ AUTHORS πŸ‘‘

Inspired on 1999-06-07 by Dominik Vogt domivogt@fvwm.org.

Rewritten on 1999-08-05 by Mikhael Goikhman migo@homemail.com.


πŸ“œ COPYING πŸ“œ

The script is distributed by the same terms as fvwm itself. See GNU General Public License for details.


πŸ’€ BUGS πŸ’€

Report bugs to fvwm-workers@fvwm.org or https://github.com/fvwmorg/fvwm3.


okay that's the whole page, bestie, you ate it πŸ’…βœ¨ this was the FVWM-MENU-DIRECTORY(1) page, dated 2026-07-31, and that date + the fvwm version vibe is your lil sign-off πŸŽ€ love u, go build some menus πŸ¦‹πŸ’–

πŸ“¦ where this page comes from