2 # Filename: grml-quickconfig
3 # Purpose: get fast access to some basic grml-scripts
4 # Authors: Grml Team <team@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 ################################################################################
10 if ! checkbootparam 'nocolor'; then
18 # switch between character sets
27 VLINE=$(repeat $MAXLEN echo -n q)
29 HILIGHT_NAME="$MAGENTA"
30 SCRIPTDIR="/usr/share/grml-quickconfig/"
33 # enable alternate console fonts
38 # helper functions {{{
41 ORIG_LEN=$(echo $(printf '%s' "$1" | sed "s#${esc}\[[0-9;]*m##g" | wc -c))
42 echo -n "${BLUE}$HLINE${NORMAL}"
44 printf "%$[${MAXLEN}-${ORIG_LEN}-2]s${BLUE}${HLINE}${NORMAL}\n"
47 print_starting_line() {
48 echo $B ${BLUE}l"$VLINE"k${NORMAL} $N
51 print_closing_line() {
52 echo $B ${BLUE}m"$VLINE"j${NORMAL} $N
56 echo $B ${BLUE}t"$VLINE"u${NORMAL} $N
60 echo $1 | sed -e "s/$2/$HILIGHT$2$NORMAL/"
72 echo Running Command $*
78 stty -echo ; read -kq $1?"Press a key: "
82 # check boot parameter {{{
85 if [ -d "$TARGET" ] ; then
87 elif [ -d "$SCRIPTDIR/$TARGET" ] ; then
88 MENUDIR="$SCRIPTDIR/$TARGET"
91 BOOT_PARAM=$(getbootparam menu)
92 if [ -n "$TARGET" ] ; then
93 get_menu_dir "$BOOT_PARAM"
99 if [ -z "$MENUDIR" ] ; then
106 for file in "$MENUDIR"/*.sh ; do
111 [ ! -e "$file" ] && break
113 if display_entry ; then
115 if [ -n "$LINE" ] ; then
116 info+="$(eval $LINE)"
128 if [ -z "$info" ] ; then
143 eval ${keymap[$INPUT]}
156 ## END OF FILE #################################################################
157 # vim:foldmethod=marker expandtab ai ft=zsh shiftwidth=3