3 grml-quickconfig \- get fast access to some basic grml-scripts
5 .B grml-quickconfig [menudir]
7 This manual page documents briefly the
13 Directory to load the menu files from. Menu files have to end with '*.sh'.
15 If menudir is an existing directory then files will be directly loaded from
16 the specified directory. If it is not a directory it will be loaded from
17 .B /usr/share/grml-quickconfig/MENUDIR/
20 If no option is provided the bootparameter
22 (if present) is used as directory.
24 grml-quickconfig provides a console based interface to get fast
25 access to some basic grml-scripts like for example grml-network,
26 netcardconfig, grml-lang, grml-x and grml2hd.
32 .B grml-quickconfig /opt/my_menu/
33 Invoke the interface and load all files ending with '*.sh'.
35 .B grml-quickconfig network
36 Test if 'network' is a directory (in the current working directory) and load all files ending with *.sh
37 from it. If it is not a valid directory
38 .B /usr/share/grml-quickconfig/network/
40 .SH Writing own menu entries
41 A menu script is a shell script with some necessary information described in this section.
44 The following predefined functions are available to write a script displaying a menu entry:
47 Print the text in one line inside the menu.
49 .B print_starting_line
50 Print the first line for a menu.
53 Print the closing line for a menu.
56 Print a delimiter line for a menu.
59 Print command and then execute it.
61 .B get_key VARIABLE_NAME
62 Get one key from user.
68 [ "$INPUT" == "c" ] && echo "C pressed"
70 # print && execute grml-lang de
73 .SS Predefined Variables
74 The following variables are predefined and could be used in a menu script:
77 Switch back to normal color
80 Highlight the used key inside the menu.
83 print_line "Configure ${HILIGHT}n${NORMAL}etwork"
87 A function named display_entry to determine if this entry shall be displayed.
92 # Always display menu item
93 display_entry() { return 0 }
95 # Only display menu item if specified program is available
97 . /etc/grml/script-functions
98 check4progs PROGRAM >/dev/null
105 A variable used to determine what shall be done to generate a menu entry. Typically
106 used in combination with print_line. Only used if display_entry returns 0.
110 # print Configure network (grml-network)
111 LINE='print_line "Configure ${HILIGHT}n${NORMAL}etwork (${HILIGHT_NAME}grml-network${NORMAL})"'
114 The following variables are optional and can be defined in a script but do not have to.
117 A variable specifying the code which should be executed if user selects this menu entry.
118 The variable $INPUT can be used to get the user input.
121 # Print the key from the user
122 FUNCTION='echo $INPUT'
131 An array containing all possible keys for executing the code specified in the FUNCTION variable, e.g:
133 # execute code in FUNCTION if c, d or e is pressed.
137 # language module for grml-quickconfig
138 LINE='print_line "Set keyboard layout (${HILIGHT_NAME}grml-lang${NORMAL}): \\
139 ${HILIGHT}d${NORMAL}e ${HILIGHT}a${NORMAL}t ${HILIGHT}c${NORMAL}h e${HILIGHT}s${NORMAL} ${HILIGHT}u${NORMAL}s"'
141 typeset -A lang_mapping
143 # map keys to language
152 # get all keys from assoc array
153 KEY=(${(k)lang_mapping})
155 # $INPUT is the user input
156 FUNCTION='run grml-lang ${lang_mapping[$INPUT]}'
158 # always display entry
163 ## END OF FILE #################################################################
164 # vim:foldmethod=marker expandtab ai ft=zsh shiftwidth=3
167 grml-quickconfig was written by the Grml Team <team@grml.org> and is based on the
168 idea of Michael Schierl <schierlm-public@gmx.de>.
170 This manual page was written by Ulrich Dangel <mru@grml.org> and Michael Prokop
171 <mika@grml.org> for the Grml project (but may be used by others).