diff options
author | Stefan Ritter <xeno@thehappy.de> | 2010-10-22 14:12:58 +0200 |
---|---|---|
committer | Stefan Ritter <xeno@thehappy.de> | 2010-10-22 14:12:58 +0200 |
commit | f0bb4145aeee24c6dd430205d58d5a50efc279c7 (patch) | |
tree | 33e57682517bcbc49a093844021ed8bb9d254845 | |
parent | 2f748564f3d8b155dce5d376788fc26339ad7d90 (diff) |
Add quilt detection
Diffstat (limited to '')
-rw-r--r-- | zsh/zshrc | 82 |
1 files changed, 9 insertions, 73 deletions
@@ -7,7 +7,7 @@ #PROMPT="$PUSER$PATKI$PHOST$PDOPP$PPATH$PCOMM " -PROMPT="%~%(1v.%F{green}%1v%f.) %% " +PROMPT="%~%(1v.%F{green}%1v%f.)%F{red}%2v%f %% " zstyle ':completion:*' special-dirs true zstyle ':completion:*:*:kill:*' menu yes select @@ -49,6 +49,10 @@ precmd() { psvar=() vcs_info [[ -n $vcs_info_msg_0_ ]] && psvar[1]="$vcs_info_msg_0_" + + if [ "$(quilt applied 2> /dev/null)" ]; then + psvar[2]=" QUILT" + fi } alias c="clear && fortune" @@ -72,11 +76,11 @@ alias t="tmux a" alias tmux='tmux -u' alias vbm="VBoxManage" -alias agu="sudo aptitude update" -alias agdu="sudo aptitude dist-upgrade" +alias agu="sudo apt-get update" +alias agdu="sudo apt-get dist-upgrade" alias acs="apt-cache search" -alias agi="sudo aptitude install" -alias as="aptitude show" +alias agi="sudo apt-get install" +alias as="apt-cache show" alias purge="sudo apt-get --purge autoremove" alias svn-uscan='uscan --verbose --force-download --rename --repack --destdir=../tarballs' @@ -116,71 +120,3 @@ case $TERM in precmd () {print -Pn "\e]0;%n@%m: %~\a"} ;; esac - -cp_p() -{ - strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \ - | awk '{ - count += $NF - if (count % 10 == 0) { - percent = count / total_size * 100 - printf "%3d%% [", percent - for (i=0;i<=percent;i++) - printf "=" - printf ">" - for (i=percent;i<100;i++) - printf " " - printf "]\r" - } - } - END { print "" }' total_size=$(stat -c '%s' "${1}") count=0 -} - -fip() { - SUBNET="" - if [[ $1 =~ ^[a-z][0-9][0-9][0-9]$ ]]; then - if [ "$(echo $1 | cut -c 1)" = "a" ]; then - SUBNET='amber' - elif [ "$(echo $1 | cut -c 1)" = "b" ]; then - SUBNET='blue' - elif [ "$(echo $1 | cut -c 1)" = "c" ]; then - SUBNET='cyan' - elif [ "$(echo $1 | cut -c 1)" = "g" ]; then - SUBNET='green' - elif [ "$(echo $1 | cut -c 1)" = "i" ]; then - SUBNET='indigo' - elif [ "$(echo $1 | cut -c 1)" = "j" ]; then - SUBNET='jade' - elif [ "$(echo $1 | cut -c 1)" = "k" ]; then - SUBNET='khaki' - elif [ "$(echo $1 | cut -c 1)" = "l" ]; then - SUBNET='lemmon' - elif [ "$(echo $1 | cut -c 1)" = "m" ]; then - SUBNET='magenta' - elif [ "$(echo $1 | cut -c 1)" = "o" ]; then - SUBNET='orange' - elif [ "$(echo $1 | cut -c 1)" = "p" ]; then - SUBNET='purple' - elif [ "$(echo $1 | cut -c 1)" = "r" ]; then - SUBNET='red' - elif [ "$(echo $1 | cut -c 1)" = "s" ]; then - SUBNET='silver' - elif [ "$(echo $1 | cut -c 1)" = "u" ]; then - SUBNET='umbra' - elif [ "$(echo $1 | cut -c 1)" = "w" ]; then - SUBNET='white' - elif [ "$(echo $1 | cut -c 1)" = "y" ]; then - SUBNET='yellow' - else - echo "Error: Unknown subnet" - fi - - if [ $SUBNET ]; then - ping $1.$SUBNET.fastwebserver.de | grep from - fi - else - echo "Syntax error: need char + 3 integer!" - fi -} - -cd ~/ |