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 If neither a commandline parameter nor a bootparameter is specified it will load the menu files from the default location
25 .B /usr/share/grml-quickconfig
27 If there exists a directory called
29 inside the default location it will be used for loading the menue.
30 .SH Determing menu directory:
36 .B /usr/share/grml-quickconfig/local/
39 .B /usr/share/grml-quickconfig/
43 grml-quickconfig provides a console based interface to get fast
44 access to some basic grml-scripts like for example grml-network,
45 netcardconfig, grml-lang, grml-x and grml2hd.
51 .B grml-quickconfig /opt/my_menu/
52 Invoke the interface and load all files ending with '*.sh'.
54 .B grml-quickconfig network
55 Test if 'network' is a directory (in the current working directory) and load all files ending with *.sh
56 from it. If it is not a valid directory
57 .B /usr/share/grml-quickconfig/network/
59 .SH Writing own menu entries
60 A menu script is a shell script with some necessary information described in this section.
63 The following predefined functions are available to write a script displaying a menu entry:
66 Print the text in one line inside the menu.
68 .B print_starting_line
69 Print the first line for a menu.
72 Print the closing line for a menu.
75 Print a delimiter line for a menu.
78 Print command and then execute it.
80 .B get_key VARIABLE_NAME
81 Get one key from user.
87 [ "$INPUT" == "c" ] && echo "C pressed"
89 # print && execute grml-lang de
92 .SS Predefined Variables
93 The following variables are predefined and could be used in a menu script:
96 Switch back to normal color
99 Highlight the used key inside the menu.
102 print_line "Configure ${HIGHLIGHT}n${NORMAL}etwork"
106 A function named display_entry to determine if this entry shall be displayed.
111 # Always display menu item
112 display_entry() { return 0 }
114 # Only display menu item if specified program is available
116 . /etc/grml/script-functions
117 check4progs PROGRAM >/dev/null
124 A variable used to determine what shall be done to generate a menu entry. Typically
125 used in combination with print_line. Only used if display_entry returns 0.
129 # print Configure network (grml-network)
130 LINE='print_line "Configure ${HIGHLIGHT}n${NORMAL}etwork (${HIGHLIGHT_NAME}grml-network${NORMAL})"'
133 The following variables are optional and can be defined in a script but do not have to.
136 A variable specifying the code which should be executed if user selects this menu entry.
137 The variable $INPUT can be used to get the user input.
140 # Print the key from the user
141 FUNCTION='echo $INPUT'
150 An array containing all possible keys for executing the code specified in the FUNCTION variable, e.g:
152 # execute code in FUNCTION if c, d or e is pressed.
156 # language module for grml-quickconfig
157 LINE='print_line "Set keyboard layout (${HIGHLIGHT_NAME}grml-lang${NORMAL}): \\
158 ${HIGHLIGHT}d${NORMAL}e ${HIGHLIGHT}a${NORMAL}t ${HIGHLIGHT}c${NORMAL}h e${HIGHLIGHT}s${NORMAL} ${HIGHLIGHT}u${NORMAL}s"'
160 typeset -A lang_mapping
162 # map keys to language
171 # get all keys from assoc array
172 KEY=(${(k)lang_mapping})
174 # $INPUT is the user input
175 FUNCTION='run grml-lang ${lang_mapping[$INPUT]}'
177 # always display entry
182 ## END OF FILE #################################################################
183 # vim:foldmethod=marker expandtab ai ft=zsh shiftwidth=3
186 grml-quickconfig was written by the Grml Team <team@grml.org> and is based on the
187 idea of Michael Schierl <schierlm-public@gmx.de>.
189 This manual page was written by Ulrich Dangel <mru@grml.org> and Michael Prokop
190 <mika@grml.org> for the Grml project (but may be used by others).