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 in *.sh.
15 If menudir is a directory files will be directly loaded from specified directory.
16 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
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 in *.sh
35 .B grml-quickconfig network
36 Test if dir is a directory and load all files edning in *.sh from it. If dir is not a valid directory
37 .B /usr/share/grml-quickconfig/network/
39 .SH Writing own menu entries
40 A menu script is a shell script with some necessary informations described in this section.
43 Following predefined functions are available to write a script displaying a menu entry:
46 Print the text in one line inside the menu. Shell
48 .B print_starting_line
49 Print the first line for a menu
52 Print the closing line for a menu
55 Print a delimiter line for a menu
58 Print command before executing it
60 .B get_key VARIABLE_NAME
67 [ "$INPUT" == "c" ] && echo "C pressed"
69 # print && execute grml-lang de
72 .SS Predefined Variables
73 Following variables are predefined and could be used in a menu script:
76 Switch back to normal color
79 Shall be used to hilight the used key for a menu
82 print_line "Configure ${HILIGHT}n${NORMAL}etwork"
86 A function named display_entry to determine if this entry shall be displayed.
91 # Always display menu item
92 display_entry() { return 0 }
94 # Only display menu item if specified program is available
96 . /etc/grml/script-functions
97 check4progs PROGRAM >/dev/null
104 A variable used to determine what shall be done to generate a menu entry. Typically
105 used in combination with print_line. Only used if display_entry returns 0.
109 # print Configure network (grml-network)
110 LINE='print_line "Configure ${HILIGHT}n${NORMAL}etwork (${HILIGHT_NAME}grml-network${NORMAL})"'
113 Following variables are optional and can be defined in a script but must not.
116 A variable specifing the code which shall be executed if user selects this menu entry.
117 The variable $INPUT can be used to get the user input.
120 # Print the key from the user
121 FUNCTION='echo $INPUT'
130 An array containig all possible keys for executing the code specified in the FUNCTION variable, e.g:
132 # execute code in FUNCTION if c, d or e is pressed.
136 # language module for grml-quickconfig
137 LINE='print_line "Set keyboard layout (${HILIGHT_NAME}grml-lang${NORMAL}): \\
138 ${HILIGHT}d${NORMAL}e ${HILIGHT}a${NORMAL}t ${HILIGHT}c${NORMAL}h e${HILIGHT}s${NORMAL} ${HILIGHT}u${NORMAL}s"'
140 typeset -A lang_mapping
142 # map keys to language
151 # get all keys from assoc array
152 KEY=(${(k)lang_mapping})
154 # $INPUT is the user input
155 FUNCTION='run grml-lang ${lang_mapping[$INPUT]}'
157 # always display entry
162 ## END OF FILE #################################################################
163 # vim:foldmethod=marker expandtab ai ft=zsh shiftwidth=3
167 Current grml-quickconfig was written by the Grml Team <team@grml.org> and is based on the
168 idea of Michael Schierl.
170 The originaly grml-quickconfig was written by Michael Schierl <schierlm-public@gmx.de>.
172 This manual page was written by Michael Prokop
173 <mika@grml.org> for the grml project (but may be used by others).