From: Michael Prokop Date: Sat, 17 Mar 2007 11:46:02 +0000 (+0100) Subject: do not set TZ via grml-setlang, added grml-quickconfig and integrated it in zsh-login X-Git-Tag: 0.9.24 X-Git-Url: http://git.grml.org/?p=grml-scripts.git;a=commitdiff_plain;h=470961a79c6f99cdec8d3063e4ad89ca6297982b do not set TZ via grml-setlang, added grml-quickconfig and integrated it in zsh-login --- diff --git a/debian/changelog b/debian/changelog index 289034d..c29db82 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +grml-scripts (0.9.24) unstable; urgency=low + + * grml-setlang: do not set $TZ anymore, we want to handle it + via /etc/timezone. + * Integrate grml-quickconfig within zsh-login. grml-quickconfig + has been contributed by Michael Schierl - thanks! + [Closes: issue97] + + -- Michael Prokop Fri, 16 Mar 2007 22:49:34 +0100 + grml-scripts (0.9.23) unstable; urgency=low * Added grml-setservices (interface for basic configuration of system diff --git a/debian/rules b/debian/rules index 6a4685c..fafd07f 100755 --- a/debian/rules +++ b/debian/rules @@ -55,7 +55,7 @@ binary-arch: build install dh_installdocs dh_installman manpages/grml-scripts.1 manpages/reread_partition_table.8 manpages/gtf.1 manpages/random-hostname.1 \ manpages/grml-setkeyboard.8 manpages/grml-setlang.8 manpages/getsf.1 manpages/grml-iptstate.8 manpages/qma.1 manpages/grml-swapon.8 \ - manpages/grml2ram.8 manpages/gsuggest.1 manpages/dirvish-setup.8 manpages/grml-setservices.8 + manpages/grml2ram.8 manpages/gsuggest.1 manpages/dirvish-setup.8 manpages/grml-setservices.8 manpages/grml-quickconfig.8 # cp --no-dereference man/*.1.gz debian/grml-scripts/usr/share/man/man1/ dh_link /usr/sbin/blacklist /usr/sbin/unblacklist \ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/align.1.gz \ diff --git a/manpages/grml-quickconfig.8 b/manpages/grml-quickconfig.8 new file mode 100644 index 0000000..0c38126 --- /dev/null +++ b/manpages/grml-quickconfig.8 @@ -0,0 +1,24 @@ +.TH grml-quickconfig 8 +.SH "NAME" +grml-quickconfig \- get fast access to some basic grml-scripts +.SH SYNOPSIS +.B grml-quickconfig +.SH DESCRIPTION +This manual page documents briefly the +.B grml-quickconfig +command. +.SH OPTIONS +grml-quickconfig does not support any options. +.SH NOTES +grml-quickconfig provides a console based interface to get fast +access to some basic grml-scripts like for example grml-network, +netcardconfig, grml-lang, grml-x and grml2hd. +.SH USAGE EXAMPLES +.TP +.B grml-quickconfig +Invoke the interface. +.SH AUTHOR +grml-quickconfig was written by Michael Schierl . +.PP +This manual page was written by Michael Prokop + for the grml project (but may be used by others). diff --git a/usr_bin/zsh-login b/usr_bin/zsh-login index 646ab3c..1a41bae 100755 --- a/usr_bin/zsh-login +++ b/usr_bin/zsh-login @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Sam Feb 17 13:58:14 CET 2007 [mika] +# Latest change: Sam Mär 17 12:40:51 CET 2007 [mika] ################################################################################ [ -r /etc/grml_version ] && GRMLVERSION=$(cat /etc/grml_version) || GRMLVERSION='(no version information available)' @@ -25,12 +25,22 @@ Happy hacking! http://grml.org/ [ -r /etc/release_info ] && cat /etc/release_info -if [ -x /usr/bin/flite ] ; then - CMDLINE=$(cat /proc/cmdline) - case "$CMDLINE" in - *swspeak*|*blind*|*brltty*|*speakup*) flite -o play -t "Finished booting" ;; - esac -fi +CMDLINE=$(cat /proc/cmdline) +case "$CMDLINE" in + *swspeak*|*blind*|*brltty*|*speakup*) + if [ -x /usr/bin/flite ] ; then + aumix -w 90 -v 90 -p 90 -m 90 + flite -o play -t "Finished booting" + fi + ;; + noquick) + # do nothing + ;; + *) # by default run grml-quickconfig, but only if running as root + if [ $(id -u) = "0" ] ; then + [ -x /usr/sbin/grml-quickconfig ] && /usr/sbin/grml-quickconfig + fi +esac exec /bin/zsh -l diff --git a/usr_sbin/grml-quickconfig b/usr_sbin/grml-quickconfig new file mode 100755 index 0000000..865e0a0 --- /dev/null +++ b/usr_sbin/grml-quickconfig @@ -0,0 +1,130 @@ +#!/usr/bin/perl +# Filename: grml-quickconfig +# Purpose: get fast access to some basic grml-scripts +# Authors: Michael Schierl +# Bug-Reports: see http://grml.org/bugs/ +# License: This file is licensed under the GPL v2. +# Latest change: Sam Mär 17 12:42:50 CET 2007 [mika] +################################################################################ + +# menu with quick config options + +# enable alternate charset support (needed for screen) +print "\e(B\e)0"; + +# variables for nice display +$W = "\e[0;32;1m"; # White +$N = "\x0f\e[0m"; # Normal +$M = "\e[0;35;1m"; # Magenta (for commands) +$B = "\e[0;34;1m\x0e"; # Blue, line drawing characters +$HLINE=$B."x".$N; # A single horizontal line drawing character + +# menu options +%menu_commands = ( + d => 'grml-lang de', + a => 'grml-lang at', + c => 'grml-lang ch', + n => 'grml-network', + e => 'netcardconfig', + i => 'grml-info', + h => 'grml2hd', + m => 'pdmenu -c', + q => 'exit', +# x and Return are handled manually +); + +# window managers +%windowmanagers = ( + d => 'dwm', + e => 'evilwm', + f => 'fluxbox', + i => 'ion3', + j => 'jwm', + k => 'pekwm', + p => 'pwm3', + t => 'twm', + v => 'fvwm', + 2 => 'fvwm2', + c => 'fvwm-crystal', + r => 'ratpoison', + 9 => 'w9wm', + w => 'windowlab', + m => 'wmi', + i => 'wmii', + n => 'wm-ng', +); + +# main loop +while(1) { + +# disable input buffering, see +# man perlfunc | less '+/ getc' +# for details +system "stty", '-icanon', 'eol', "\001"; + +# main loop +$command=""; +while($command eq "") { +print <<"EOF"; + + ${B}lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk${N} + $HLINE Welcome to ${M}grml-quickconfig${M} $HLINE + $HLINE Press a highlighted key to perform an action, or press $HLINE + $HLINE ${W}Return${N} or ${W}q${N} to go back to the shell. $HLINE + ${B}tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu${N} + $HLINE Set keyboard layout (${M}grml-lang${N}): ${W}d${N}e ${W}a${N}t ${W}c${N}h $HLINE + $HLINE Configure ${W}n${N}etwork (${M}grml-network${N}) $HLINE + $HLINE -> Configure ${W}e${N}thernet card directly (${M}netcardconfig${N}) $HLINE + ${B}tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu${N} + $HLINE Show ${W}i${N}nformation about grml (${M}grml-info${N}) $HLINE + $HLINE Start ${W}x${N} (${M}grml-x${N}) $HLINE + $HLINE Show an application ${W}m${N}enu (${M}pdmenu${N}) $HLINE + $HLINE Install grml to ${W}h${N}ard disk (${M}grml2hd${N}) $HLINE + ${B}mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj${N} + +EOF +print "Press a key: ".$M; +$x = getc; +print $N.$/.$/; +if (defined($menu_commands{$x})) { + $command = $menu_commands{$x}; +} elsif ($x eq "\n") { + $command= 'exit'; +} elsif ($x eq "x") { + print <<"EOF"; + + ${B}lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk${N} + $HLINE Select a window manager (unsorted list): $HLINE + $HLINE Press any other key to return to the main menu. $HLINE + ${B}tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu${N} + $HLINE ${W}f${N}luxbox ${W}d${N}wm ${W}e${N}vilwm ion${W}3${N} ${W}j${N}wm pe${W}k${N}wm ${W}p${N}wm3 ${W}t${N}wm ${W}r${N}atpoison $HLINE + $HLINE f${W}v${N}wm fvwm${W}2${N} fvwm-${W}c${N}rystal w${W}9${N}wm ${W}w${N}indowlab w${W}m${N}i wm${W}i${N}i wm-${W}n${N}g $HLINE + ${B}mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj${N} + +EOF + print "Press a key: ".$M; + $x = getc; + print $N.$/.$/; + if (defined($windowmanagers{$x})) { + $command = "su - grml -c 'grml-x ".$windowmanagers{$x}."'"; + } else { + print "Unknown key.\n"; + } +} else { + print "Unknown key.\n"; +} +} + +# reenable input buffering +system "stty", 'icanon', 'eol', '^@'; + +if ($command eq "exit") { + last; +} +print $W . "Running command: " . $M . $command . $N . $/; +system($command); +print $/; +} +print "Happy hacking!\n"; + +## END OF FILE ################################################################# diff --git a/usr_sbin/grml-setlang b/usr_sbin/grml-setlang index 3efda81..7079e76 100755 --- a/usr_sbin/grml-setlang +++ b/usr_sbin/grml-setlang @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Sam Dez 16 18:20:42 CET 2006 [mika] +# Latest change: Fre Mär 16 22:49:29 CET 2007 [mika] ################################################################################ PN="$(basename $0)" @@ -71,7 +71,7 @@ if [ -z "$NONINTERACTIVE" ] ; then LANGUAGE=$($DIALOG --stdout --title "$PN" --default-item $DEFAULT_LANGUAGE --radiolist \ "Which language do you want to use? -This will affect \$LANG, \$LANGUAGE, \$LC_MESSAGES and \$TZ. +This will affect \$LANG, \$LANGUAGE and \$LC_MESSAGES. Notice: if you want to adjust /etc/locale.gen (defines which locales should be generated by locale-gen) @@ -173,7 +173,7 @@ cat > $CONFFILE <