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 Determining 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 grml-debootstrap.
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"
105 As highlighting the name as well as the keyboard shortcuts is common
106 in a menu entry there are two shortcuts for highlighting.
107 .SS Highlight a single character
108 To highlight a single character, for example the shortcut, use
110 and the next character will be highlighted. If you want to just write ^ escape the
111 character with a backslash.
112 print_line "Configure ^network \\^ is nice"
114 To highlight a range, for example the command, use
116 and the text between / wll be highlighted. If you want to just write / escape the
117 character with a backslash.
118 print_line "Configure ^network (/grml-network/)"
122 A function named display_entry to determine if this entry shall be displayed.
127 # Always display menu item
128 display_entry() { return 0 }
130 # Only display menu item if specified program is available
132 . /etc/grml/script-functions
133 check4progs PROGRAM >/dev/null
140 A variable used to determine what shall be done to generate a menu entry. Typically
141 used in combination with print_line. Only used if display_entry returns 0.
145 # print Configure network (grml-network)
146 LINE='print_line "Configure ^network (/grml-network/)"'
149 The following variables are optional and can be defined in a script but do not have to.
152 A variable specifying the code which should be executed if user selects this menu entry.
153 The variable $INPUT can be used to get the user input.
156 # Print the key from the user
157 FUNCTION='echo $INPUT'
166 An array containing all possible keys for executing the code specified in the FUNCTION variable, e.g:
168 # execute code in FUNCTION if c, d or e is pressed.
172 # language module for grml-quickconfig
173 LINE='print_line "Set keyboard layout (/grml-lang/): ^de ^at ^ch e^s ^us"'
175 typeset -A lang_mapping
177 # map keys to language
186 # get all keys from assoc array
187 KEY=(${(k)lang_mapping})
189 # $INPUT is the user input
190 FUNCTION='run grml-lang ${lang_mapping[$INPUT]}'
192 # always display entry
197 ## END OF FILE #################################################################
198 # vim:foldmethod=marker expandtab ai ft=zsh shiftwidth=3
201 grml-quickconfig was written by the Grml Team <team@grml.org> and is based on the
202 idea of Michael Schierl <schierlm-public@gmx.de>.
204 This manual page was written by Ulrich Dangel <mru@grml.org> and Michael Prokop
205 <mika@grml.org> for the Grml project (but may be used by others).