HLINE="$B x $N"
VLINE=$(repeat $MAXLEN echo -n q)
-HILIGHT="$GREEN"
-HILIGHT_NAME="$MAGENTA"
+HIGHLIGHT="$GREEN"
+HIGHLIGHT_NAME="$MAGENTA"
SCRIPTDIR="/usr/share/grml-quickconfig/"
echo $B ${BLUE}t"$VLINE"u${NORMAL} $N
}
-hilight_char() {
- echo $1 | sed -e "s/$2/$HILIGHT$2$NORMAL/"
+highlight_char() {
+ echo $1 | sed -e "s/$2/$HIGHLIGHT$2$NORMAL/"
}
print_menu() {
Highlight the used key inside the menu.
.TP
.B Example
- print_line "Configure ${HILIGHT}n${NORMAL}etwork"
+ print_line "Configure ${HIGHLIGHT}n${NORMAL}etwork"
.SS MUST Provide
.TP
.B display_entry
.RS
.B \ Example
# print Configure network (grml-network)
- LINE='print_line "Configure ${HILIGHT}n${NORMAL}etwork (${HILIGHT_NAME}grml-network${NORMAL})"'
+ LINE='print_line "Configure ${HIGHLIGHT}n${NORMAL}etwork (${HIGHLIGHT_NAME}grml-network${NORMAL})"'
.RE 1
.SS Optional entries
The following variables are optional and can be defined in a script but do not have to.
.SS Complete Example
# language module for grml-quickconfig
- LINE='print_line "Set keyboard layout (${HILIGHT_NAME}grml-lang${NORMAL}): \\
- ${HILIGHT}d${NORMAL}e ${HILIGHT}a${NORMAL}t ${HILIGHT}c${NORMAL}h e${HILIGHT}s${NORMAL} ${HILIGHT}u${NORMAL}s"'
+ LINE='print_line "Set keyboard layout (${HIGHLIGHT_NAME}grml-lang${NORMAL}): \\
+ ${HIGHLIGHT}d${NORMAL}e ${HIGHLIGHT}a${NORMAL}t ${HIGHLIGHT}c${NORMAL}h e${HIGHLIGHT}s${NORMAL} ${HIGHLIGHT}u${NORMAL}s"'
typeset -A lang_mapping
# print the heading
LINE='print_line "Welcome to grml-quickconfig";
print_line "Press a highlighted key to perform an action, or press";
-print_line "${HILIGHT}Return${NORMAL} or ${HILIGHT}q${NORMAL} to go back to the shell.";
+print_line "${HIGHLIGHT}Return${NORMAL} or ${HIGHLIGHT}q${NORMAL} to go back to the shell.";
print_delim;
'
# language module for grml-quickconfig
-LINE='print_line "Set keyboard layout (${HILIGHT_NAME}grml-lang${NORMAL}): \
-${HILIGHT}d${NORMAL}e ${HILIGHT}a${NORMAL}t ${HILIGHT}c${NORMAL}h e${HILIGHT}s${NORMAL} ${HILIGHT}u${NORMAL}s"'
+LINE='print_line "Set keyboard layout (${HIGHLIGHT_NAME}grml-lang${NORMAL}): \
+${HIGHLIGHT}d${NORMAL}e ${HIGHLIGHT}a${NORMAL}t ${HIGHLIGHT}c${NORMAL}h e${HIGHLIGHT}s${NORMAL} ${HIGHLIGHT}u${NORMAL}s"'
typeset -A lang_mapping
# grml-network module for grml-quickconfig
-LINE='print_line "Configure ${HILIGHT}n${NORMAL}etwork (${HILIGHT_NAME}grml-network${NORMAL})"'
+LINE='print_line "Configure ${HIGHLIGHT}n${NORMAL}etwork (${HIGHLIGHT_NAME}grml-network${NORMAL})"'
KEY=(n)
FUNCTION='run grml-network'
# netcardconfig module for grml-quickconfig
-LINE='print_line "-> Configure ${HILIGHT}e${NORMAL}thernet card directly (${HILIGHT_NAME}netcardconfig${NORMAL})"'
+LINE='print_line "-> Configure ${HIGHLIGHT}e${NORMAL}thernet card directly (${HIGHLIGHT_NAME}netcardconfig${NORMAL})"'
KEY=(n)
FUNCTION='run netcardconfig'
# grml-info module for grml-quickconfig
-LINE='print_line "Show ${HILIGHT}i${NORMAL}nformation about grml (${HILIGHT_NAME}grml-info${NORMAL})"'
+LINE='print_line "Show ${HIGHLIGHT}i${NORMAL}nformation about grml (${HIGHLIGHT_NAME}grml-info${NORMAL})"'
KEY=(i)
FUNCTION="run grml-info"
# window manager module for grml-quickconfig
-LINE='print_line "Start ${HILIGHT}x${NORMAL} (${HILIGHT_NAME}grml-x${NORMAL})"'
+LINE='print_line "Start ${HIGHLIGHT}x${NORMAL} (${HIGHLIGHT_NAME}grml-x${NORMAL})"'
KEY=(x)
FUNCTION='wm_menu'
# test if word could be added to current line
if [ $[${(c)#key} + $LEN] -lt $MAXLEN ] ; then
LEN+=${(c)#wm}
- line+="$(hilight_char $value $key) "
+ line+="$(highlight_char $value $key) "
else
LEN=0
output+="$line"
# application menu module for grml-quickconfig
-LINE='print_line "Show an application ${HILIGHT}m${NORMAL}enu (${HILIGHT_NAME}pdmenu${NORMAL})"'
+LINE='print_line "Show an application ${HIGHLIGHT}m${NORMAL}enu (${HIGHLIGHT_NAME}pdmenu${NORMAL})"'
KEY=(m)
MENU_PROGNAME=pdmenu
FUNCTION="run $MENU_PROGNAME"
-LINE='print_line "Install grml to ${HILIGHT}h${NORMAL}ard disk (${HILIGHT_NAME}grml2hd${NORMAL}"'
+LINE='print_line "Install grml to ${HIGHLIGHT}h${NORMAL}ard disk (${HIGHLIGHT_NAME}grml2hd${NORMAL}"'
KEY=(m)
HD_APP=grml2hd
FUNCTION="run $HD_APP"