dchange(): use aptitude to retrieve changelog
[grml-etc-core.git] / etc / zsh / zshrc
index 9891492..3b6d6de 100644 (file)
@@ -3,7 +3,7 @@
 # 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: Fre Jun 29 11:46:37 CEST 2007 [mika]
+# Latest change: Mon Jul 02 18:17:08 CEST 2007 [mika]
 ################################################################################
 # This file is sourced only for interactive shells. It
 # should contain commands to set up aliases, functions,
@@ -789,6 +789,11 @@ ${BLUE}%n${NO_COLOUR}@%m %40<...<%B%~%b%<< %# "
   alias mdstat='cat /proc/mdstat'
   alias ...='cd ../../'
 
+  # generate alias named "$KERNELVERSION-reboot" so you can use boot with kexec:
+  if [ -x /sbin/kexec ] ; then
+     alias "$(uname -r)-reboot"="kexec -l --initrd=/boot/initrd.img-"$(uname -r)" --command-line=\"$(cat /proc/cmdline)\" /boot/vmlinuz-"$(uname -r)""
+  fi
+
   alias cp='nocorrect cp'         # no spelling correction on cp
   alias mkdir='nocorrect mkdir'   # no spelling correction on mkdir
   alias mv='nocorrect mv'         # no spelling correction on mv
@@ -1251,8 +1256,13 @@ If you want to use xinit anyway please call \"/usr/bin/xinit\"."
       if [ -r /usr/share/doc/${1}/changelog.Debian.gz ] ; then
          most /usr/share/doc/${1}/changelog.Debian.gz
       else
-         if [ -r /usr/share/doc/${1}/changelog.gz ] ; then
-            most /usr/share/doc/${1}/changelog.gz
+         if type -p aptitude &>/dev/null ; then
+            echo "No changelog for package $1 found, using aptitude to retrieve it."
+            if isgrml ; then
+              aptitude -t unstable changelog tsclient
+            else
+              aptitude changelog ${1}
+            fi
          else
             echo "No changelog for package $1 found, sorry."
             return 1
@@ -1411,13 +1421,8 @@ If you want to use xinit anyway please call \"/usr/bin/xinit\"."
 
   # just press 'asdf' keys to toggle between dvorak and us keyboard layout
   aoeu() {
-     if [ -n "$XKEYBOARD" -a -n "$KEYTABLE" ] ; then
-        echo -n "Switching to $KEYTABLE keyboard layout: "
-        [ -z "$DISPLAY" ] && $SUDO loadkeys $KEYTABLE &>/dev/null || setxkbmap $XKEYBOARD &>/dev/null
-     else
-        echo -n 'Switching to us keyboard layout: '
-        [ -z "$DISPLAY" ] && $SUDO loadkeys us &>/dev/null || setxkbmap us &>/dev/null
-     fi
+     echo -n 'Switching to us keyboard layout: '
+     [ -z "$DISPLAY" ] && $SUDO loadkeys us &>/dev/null || setxkbmap us &>/dev/null
      echo 'Done'
   }
   asdf() {