From aaebb85b04148aafcad855c310254b0568ddad72 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 24 Feb 2007 19:23:28 +0100 Subject: [PATCH] improved documentation about startup of zsh; added function ytdl; work around non utf8 capable software --- debian/changelog | 5 +++++ etc/skel/.zshrc | 26 +++++++++++++++++++++++++- etc/zsh/zlogin | 4 +++- etc/zsh/zlogout | 3 ++- etc/zsh/zprofile | 4 ++-- etc/zsh/zshenv | 11 +++++++---- etc/zsh/zshrc | 2 +- 7 files changed, 45 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 470a07b..55bbefd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,11 @@ grml-etc-core (0.2.23) unstable; urgency=low /bin/sh or /bin/bash. :-/ - add a space character in some abbreviation expansions so it's better readable. + * /etc/skel/.zshrc: + - added function ytdl (download video from youtube) + - work around non utf8 capable software in utf environment + using aliases for mrxvt, aterm and centericq + * /etc/zsh/*: improved documentation about startup of zsh -- Michael Prokop Sat, 24 Feb 2007 17:30:11 +0100 diff --git a/etc/skel/.zshrc b/etc/skel/.zshrc index 6146f47..0c40461 100644 --- a/etc/skel/.zshrc +++ b/etc/skel/.zshrc @@ -3,7 +3,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: Son Dez 17 14:50:06 CET 2006 [mika] +# Latest change: Sam Feb 24 19:21:35 CET 2007 [mika] ################################################################################ # source ~/.zshrc.global {{{ @@ -166,6 +166,19 @@ # check whether Debian's package management (dpkg) is running alias check_dpkg_running="$SUDO dpkg_running" + +# work around non utf8 capable software in utf environment + if [ -x /usr/bin/mrxvt ] ; then + isutfenv && [ -n "$LANG" ] && alias mrxvt="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} mrxvt" + fi + + if [ -x /usr/bin/aterm ] ; then + isutfenv && [ -n "$LANG" ] && alias aterm="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} aterm" + fi + + if [ -x /usr/bin/centericq ] ; then + isutfenv && [ -n "$LANG" ] && alias centericq="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} centericq" + fi # }}} ## useful functions {{{ @@ -208,6 +221,17 @@ which google &>/dev/null && gex () { google "\"[ $1]\" $*" } # exact search at google + # download video from youtube + ytdl() { + if ! [ -n "$2" ] ; then + print "Usage: ydtl http://youtube.com/watch?v=.... outputfile.flv">&2 + return 1 + else + wget -O${2} "http://youtube.com/get_video?"${${${"$(wget -o/dev/null -O- "${1}" | grep -e watch_fullscreen)"}##*watch_fullscreen\?}%%\&fs=*} + fi + } + + # Function Usage: doc packagename doc() { cd /usr/share/doc/$1 && ls } _doc() { _files -W /usr/share/doc -/ } diff --git a/etc/zsh/zlogin b/etc/zsh/zlogin index 7f655fd..0f16342 100644 --- a/etc/zsh/zlogin +++ b/etc/zsh/zlogin @@ -3,13 +3,15 @@ # 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: Die Nov 16 13:25:04 CET 2004 [mika] +# Latest change: Sam Feb 24 19:05:18 CET 2007 [mika] ################################################################################ # This file is sourced only for login shells. It # should contain commands that should be executed only # in login shells. It should be used to set the terminal # type and run a series of external commands (fortune, # msgs, from, etc.) +# Note that using zprofile and zlogin, you are able to +# run commands for login shells before and after zshrc. # # Global Order: zshenv, zprofile, zshrc, zlogin ################################################################################ diff --git a/etc/zsh/zlogout b/etc/zsh/zlogout index f83d29e..643fd2c 100644 --- a/etc/zsh/zlogout +++ b/etc/zsh/zlogout @@ -3,8 +3,9 @@ # 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: Son Nov 26 10:30:13 CET 2006 [mika] +# Latest change: Sam Feb 24 19:06:14 CET 2007 [mika] ################################################################################ +# Shutdown files (.zlogout and zlogout) are run, when a login shell exits. # make sure screen is empty on exit clear diff --git a/etc/zsh/zprofile b/etc/zsh/zprofile index 6b79d4e..11b1dc2 100644 --- a/etc/zsh/zprofile +++ b/etc/zsh/zprofile @@ -3,11 +3,11 @@ # 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: Fri Nov 11 00:08:57 CET 2005 [mika] +# Latest change: Sam Feb 24 18:59:47 CET 2007 [mika] ################################################################################ # This file is sourced only for login shells (i.e. shells # invoked with "-" as the first character of argv[0], and -# shells invoked with the -l flag.) +# shells invoked with the -l flag). It's read after zshenv. # # Global Order: zshenv, zprofile, zshrc, zlogin ################################################################################ diff --git a/etc/zsh/zshenv b/etc/zsh/zshenv index 365b0db..0830328 100644 --- a/etc/zsh/zshenv +++ b/etc/zsh/zshenv @@ -3,18 +3,21 @@ # 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 24 17:32:18 CET 2007 [mika] +# Latest change: Sam Feb 24 18:59:11 CET 2007 [mika] ################################################################################ # This file is sourced on all invocations of the shell. -# If the -f flag is present or if the NO_RCS option is -# set within this file, all other initialization files -# are skipped. +# It is the 1st file zsh reads; it's read for every shell, +# even if started with -f (setopt NO_RCS), all other +# initialization files are skipped. # # This file should contain commands to set the command # search path, plus other important environment variables. # This file should not contain commands that produce # output or assume the shell is attached to a tty. # +# Notice: .zshenv is the same, execpt that it's not read +# if zsh is started with -f +# # Global Order: zshenv, zprofile, zshrc, zlogin ################################################################################ diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index f45f936..8c77a82 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -3,7 +3,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 24 17:32:43 CET 2007 [mika] +# Latest change: Sam Feb 24 19:06:28 CET 2007 [mika] ################################################################################ # This file is sourced only for interactive shells. It # should contain commands to set up aliases, functions, -- 2.1.4