zshrc: update function swspeak for new script swspeak-setup
[grml-etc-core.git] / etc / zsh / zshrc
index 621a362..54863d3 100644 (file)
@@ -3,7 +3,6 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
-# Latest change: Wed Aug 06 23:50:53 CEST 2008 [mika]
 ################################################################################
 # This file is sourced only for interactive shells. It
 # should contain commands to set up aliases, functions,
@@ -92,6 +91,13 @@ if [[ $ZSH_PROFILE_RC -gt 0 ]] ; then
 fi
 # }}}
 
+# setting some default values {{{
+NOCOR=${NOCOR:-0}
+NOMENU=${NOMENU:-0}
+NOPRECMD=${NOPRECMD:-0}
+BATTERY=${BATTERY:-0}
+# }}}
+
 # {{{ check for version/system
 # check for versions (compatibility reasons)
 is4(){
@@ -2053,18 +2059,25 @@ iso2utf() {
 
 # set up software synthesizer via speakup
 swspeak() {
-    aumix -w 90 -v 90 -p 90 -m 90
-    if ! [[ -r /dev/softsynth ]] ; then
-        flite -o play -t "Sorry, software synthesizer not available. Did you boot with swspeak bootoption?"
-        return 1
-    else
-        setopt singlelinezle
-        unsetopt prompt_cr
-        export PS1="%m%# "
-        nice -n -20 speechd-up
-        sleep 2
-        flite -o play -t "Finished setting up software synthesizer"
-    fi
+    if [ -x /usr/sbin/swspeak-setup ] ; then
+       setopt singlelinezle
+       unsetopt prompt_cr
+       export PS1="%m%# "
+       /usr/sbin/swspeak-setup $@
+     else # old version:
+        aumix -w 90 -v 90 -p 90 -m 90
+        if ! [[ -r /dev/softsynth ]] ; then
+            flite -o play -t "Sorry, software synthesizer not available. Did you boot with swspeak bootoption?"
+            return 1
+        else
+           setopt singlelinezle
+           unsetopt prompt_cr
+           export PS1="%m%# "
+            nice -n -20 speechd-up
+            sleep 2
+            flite -o play -t "Finished setting up software synthesizer"
+        fi
+     fi
 }
 
 # I like clean prompt, so provide simple way to get that
@@ -2100,8 +2113,8 @@ use them on a non-grml-system just get the tar.gz from
 http://deb.grml.org/ or get the files from the mercurial
 repository:
 
-  http://hg.grml.org/grml-etc-core/raw-file/tip/etc/skel/.zshrc
-  http://hg.grml.org/grml-etc-core/raw-file/tip/etc/zsh/zshrc
+  http://git.grml.org/?p=grml-etc-core.git;a=blob_plain;f=etc/zsh/zshrc
+  http://git.grml.org/?p=grml-etc-core.git;a=blob_plain;f=etc/skel/.zshrc
 
 If you want to stay in sync with zsh configuration of grml
 run '\''ln -sf /etc/skel/.zshrc $HOME/.zshrc'\'' and configure
@@ -2132,7 +2145,12 @@ the zsh yet. :)
   "NOCOR=1    zsh" => deactivate automatic correction
   "NOMENU=1   zsh" => do not use auto menu completion (note: use ctrl-d for completion instead!)
   "NOPRECMD=1 zsh" => disable the precmd + preexec commands (set GNU screen title)
-  "BATTERY=1  zsh" => activate battery status (via acpi) on right side of prompt'
+  "BATTERY=1  zsh" => activate battery status (via acpi) on right side of prompt
+
+A value greater than 0 is enables a feature; a value equal to zero
+disables it. If you like one or the other of these settings, you can
+add them to ~/.zshenv to ensure they are set when sourcing grml'\''s
+zshrc.'
 
     print "
 $bg[white]$fg[black]