logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

qmenu - A tool to create simple menus for terminal interfaces

Authors

       Written by Stefano Teodorani - https://github.com/teopost.
       Translated by Lorenzo Teodorani - https://github.com/teopost2.
       Thanks to Giovanni Juan Oteri - https://twitter.com/giovannioteri

Description

       qmenu creates textual menus in an easy and intuitive way.

       OPTIONS-init create the configuration file "qmenu.cfg"

       -model create a menu file model "model.mnu"

       menu_filename
              file (with .mnu extension) containing the menu's outline

Item Area

       In this section, for each menu item you can define:

       •   The action to perform

       •   An help message

       •   An empty row

       Each item is made up by 3 lines:

           1. Menu option
           2. Command to perform
           3. Help message

       1.  In the first line, insert the first character of the string containing the menu option

       2.  In the second line you can specify:

       •   A shell command

       •   A submenu to open ($menuname without extension)

       •   A reserved command (return to go to the previous menu, end to quit menu)

       3.  In the third line you can specify a message. This message will replace  the  variable  TITLE  in  the
           "Screen area"

       Example:

           %1
           ls -lisa; pause
           This item shows shell file list

Name

       qmenu - A tool to create simple menus for terminal interfaces

Option Area

       This section contains a series of generic settings:

           TITOLO - Menu title
           RVS_ROW=0,22 - Lines displayed in reverse. In this case the lines 0 22
           NOKEYDISP - Disables automatic visualization of function keys labels (ET[1-10])
           ET[1-10] - Text shown to function key n if NOKEYDISP commented
           FZ[1-10] - Command (shell) for the function key n
           PW[1-10] - Password to set for the function key n
           SHELL=sh - Pressing shift-f1 starts a shell session
           EDITOR=vi - Pressing shift-f2 starts vi with the current menu

Reporting Bugs

       Please, report bugs to <https://github.com/teopost/qmenu/issues>
       General help using software: <https://github.com/teopost/qmenu>
       Report qmenu translation bugs to <https://github.com/teopost/qmenu/issues>

Screen Area

       This  area  spans from the beginning of the file to the symbol $$, and contains the "drawing" of the menu
       in text format. To make menu options selectable, they must be included between two symbols ^

       Example:

           ^1. Option 1^
           ^2. Option 2^

       The options can be highlighted with arrow keys or by pressing the first character of the string. In  this
       area you can also add some variables according to the following syntax:

           x[NAME_VARIABILE]

       The  name  of  the  variable is made up by a prefix (x) and a name between square brackets. The possibile
       values are:

           * c - Centered
           * l - Left-justified
           * r - Right-justified

       Note: If the symbol is capitalized, the value is shown in reverse

       Variables can assume the following values:

           * TIME - Current time
           * MENUNAME - Menu's name
           * INFOTERM - Terminal's name
           * MNUTRACE - Path menu

       Special variables:

           & - Cursor position
           ${PATH} - Displays the contents of the environment variable PATH

       Example:

           C[TITLE] - Menu title centered and in reverse

Synopsis

qmenu[OPTION] [menu_filename]

Synopsys

       qmenu  allows  you  to  create  menus  for  textual interfaces in an easy and intuitive way. Each menu is
       defined in a file (with extension .mnu) containing the menu's outline. The  file  is  composed  by  three
       sections:

           1. Screen Area
           2. Item Area
           3. Option Area

       Sections are delimited by the characters $$ and %%, respectively:

           Screen area
           $$
           Item area
           %%
           Option area

See Also