diff options
author | Hugues Hiegel <hugues.hiegel@openwide.fr> | 2009-06-05 11:11:05 +0200 |
---|---|---|
committer | Hugues Hiegel <hugues.hiegel@openwide.fr> | 2009-06-05 11:11:05 +0200 |
commit | 480e555229ff44478b9b3bdc3d2eee78c9ca8130 (patch) | |
tree | da85dcbc90d383262f576348bf9673cd9eb3bc58 | |
parent | 8865b771cf355eb00466e9b0f501c14f9979e144 (diff) | |
parent | bcd0823d15c93d0c6ec404860bb45aa8b4e6d283 (diff) |
Merge branch 'master' of maison:/git/zdotdir
-rw-r--r-- | 01_Functions.zsh | 14 | ||||
-rw-r--r-- | 12_Prompts.zsh | 16 | ||||
-rw-r--r-- | net:sweethome/host:paranoid/user:hugues/Environment.zsh (renamed from net:sweethome/user:hugues/Environment.zsh) | 0 | ||||
-rw-r--r-- | net:sweethome/host:prunelle/Environment.zsh | 18 | ||||
-rw-r--r-- | net:sweethome/host:prunelle/sys:Darwin/Aliases.zsh (renamed from net:sweethome/host:prunelle/Aliases.zsh) | 10 | ||||
-rw-r--r-- | net:sweethome/host:prunelle/sys:Darwin/Environment.zsh | 25 | ||||
-rw-r--r-- | user:hugues/Environment.zsh | 2 | ||||
-rw-r--r-- | zshrc | 13 |
8 files changed, 62 insertions, 36 deletions
diff --git a/01_Functions.zsh b/01_Functions.zsh index ad4c10a..3b7a517 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -106,7 +106,17 @@ get_git_branch () fi else # Initial commit - my_git_branch="$(basename $GIT_DIR/$(cat $GIT_DIR/HEAD | sed 's/^\([0-9a-f]\{2\}\)\([0-9a-f]\{38\}\)$/objects\/\1\/\2/;s/^ref: //'))" + if [ -L $GIT_DIR/HEAD -a ! -f $GIT_DIR/HEAD ] + then + my_git_branch="$(basename $GIT_DIR/$(stat --printf="%N\n" $GIT_DIR/HEAD | tr '`' "'" | cut -d\' -f4))" + else + my_git_branch="$(basename $GIT_DIR/$(cat $GIT_DIR/HEAD | sed 's/^\([0-9a-f]\{2\}\)\([0-9a-f]\{38\}\)$/objects\/\1\/\2/;s/^ref: //'))" + fi + fi + + if [ "$(git-status 2>&- | grep "new file" | head -n1)" != "" ] ; then + # ADDED FILES + my_git_branch=$my_git_branch" (+)" fi echo $my_git_branch @@ -131,7 +141,7 @@ get_git_status () if [ "$(git-diff --cached 2>&- | grep '^diff ' | head -n1 )" != "" ] ; then cached="yes" fi - if [ "$(git-ls-files -m 2>&-)" != "" ] ; then + if [ "$(git-ls-files -m 2>&- | head -n1)" != "" ] ; then not_up_to_date="yes" fi diff --git a/12_Prompts.zsh b/12_Prompts.zsh index bdbb55a..68bcc5f 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -115,11 +115,11 @@ update_prompt() SSH_AGENT_KEYLIST="$( ssh-add -l | grep "^[[:digit:]]\+ \([[:digit:]a-f]\{2\}:\)\{15\}[[:digit:]a-f]\{2\} .* (.*)$" )" local _is_multibyte_compliant - if ( echo ${(k)options} | grep "multibyte" >/dev/null && [ "$options[multibyte]" = "on" ] ) + if ( echo ${(k)options} | grep "multibyte" >/dev/null ) && [ "$options[multibyte]" = "on" ] then - _is_multibyte_compliant=1 + _is_multibyte_compliant="yes it is !" else - _is_multibyte_compliant=0 + _is_multibyte_compliant="" fi # Check if it is a forwarded agent @@ -129,20 +129,20 @@ update_prompt() if [ "$SSH_AGENT_KEYLIST" != "" ] then AGENTCOLOR="has_keys" - AGENTCHAR=${AGENT_WITH_KEYS:-$( [ _is_multibyte_compliant ] && echo "★" || echo "§" )} + AGENTCHAR=${AGENT_WITH_KEYS:-$( [ $_is_multibyte_compliant ] && echo "★" || echo "S" )} else AGENTCOLOR="empty" - AGENTCHAR=${AGENT_EMPTY:-$( [ _is_multibyte_compliant ] && echo "☆" || echo "§" )} + AGENTCHAR=${AGENT_EMPTY:-$( [ $_is_multibyte_compliant ] && echo "☆" || echo "S" )} fi else # That's a forwarded agent if [ "$SSH_AGENT_KEYLIST" != "" ] then AGENTCOLOR="has_keys" - AGENTCHAR=${AGENT_SOCK_WITH_KEYS:-$( [ _is_multibyte_compliant ] && echo "●" || echo "@" )} + AGENTCHAR=${AGENT_SOCK_WITH_KEYS:-$( [ $_is_multibyte_compliant ] && echo "●" || echo "@" )} else AGENTCOLOR="empty" - AGENTCHAR=${AGENT_SOCK_EMPTY:-$( [ _is_multibyte_compliant ] && echo "○" || echo "@" )} + AGENTCHAR=${AGENT_SOCK_EMPTY:-$( [ $_is_multibyte_compliant ] && echo "○" || echo "@" )} fi fi @@ -155,7 +155,7 @@ update_prompt() if [ "`strings /proc/$GPG_AGENT_PID/cmdline | head -n1`" = "gpg-agent" ] then AGENTCOLOR="has_keys" - AGENTS=$AGENTS$C_$agent_colors[$AGENTCOLOR]$_C${GPG_AGENT_RUNNING:-$( [ _is_multibyte_compliant ] && echo "☆" || echo "G" )} + AGENTS=$AGENTS$C_$agent_colors[$AGENTCOLOR]$_C${GPG_AGENT_RUNNING:-$( [ $_is_multibyte_compliant ] && echo "☆" || echo "G" )} fi fi AGENTS=${AGENTS:+$C_$prompt_colors[bar]$_C"-"$AGENTS} diff --git a/net:sweethome/user:hugues/Environment.zsh b/net:sweethome/host:paranoid/user:hugues/Environment.zsh index 22ede24..22ede24 100644 --- a/net:sweethome/user:hugues/Environment.zsh +++ b/net:sweethome/host:paranoid/user:hugues/Environment.zsh diff --git a/net:sweethome/host:prunelle/Environment.zsh b/net:sweethome/host:prunelle/Environment.zsh index 248b742..e96318b 100644 --- a/net:sweethome/host:prunelle/Environment.zsh +++ b/net:sweethome/host:prunelle/Environment.zsh @@ -8,24 +8,6 @@ ## these files with or without this notice. ## -if ( [ "`uname -s`" = "Darwin" ] ) -then - export DISPLAY=:0 - - ## Fink / DarwinPorts - - MANPATH=/usr/share/man - INFOPATH=/usr/share/info - - for i in usr/X11R6 dp sw ; do - export PATH=$PATH:/$i/bin:/$i/sbin - export MANPATH=$MANPATH:/$i/share/man - export INFOPATH=$INFOPATH:/$i/share/info - done - - typeset -gU PATH MANPATH INFOPATH -fi - PS1_USER="1" if [ "$OSTYPE" = "linux-gnu" ] then diff --git a/net:sweethome/host:prunelle/Aliases.zsh b/net:sweethome/host:prunelle/sys:Darwin/Aliases.zsh index 7c2a390..cc1173a 100644 --- a/net:sweethome/host:prunelle/Aliases.zsh +++ b/net:sweethome/host:prunelle/sys:Darwin/Aliases.zsh @@ -7,10 +7,6 @@ ## You are encouraged to use, modify, and redistribute ## these files with or without this notice. ## - -if [ "$OSTYPE" == "Darwin" ] -then - a port='sudo port' - a ls='ls -FG' - a aless='open -a /Applications/DarwinPorts/AquaLess.app' -fi +a port='sudo port' +a ls='ls -FG' +a aless='open -a /Applications/DarwinPorts/AquaLess.app' diff --git a/net:sweethome/host:prunelle/sys:Darwin/Environment.zsh b/net:sweethome/host:prunelle/sys:Darwin/Environment.zsh new file mode 100644 index 0000000..5fac52b --- /dev/null +++ b/net:sweethome/host:prunelle/sys:Darwin/Environment.zsh @@ -0,0 +1,25 @@ +#!/bin/zsh +## +## Part of configuration files for Zsh 4 +## by Hugues Hiegel <hugues@hiegel.fr> +## +## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS +## +## You are encouraged to use, modify, and redistribute +## these files with or without this notice. +## + +export DISPLAY=:0 + +## Fink / DarwinPorts + +MANPATH=/usr/share/man +INFOPATH=/usr/share/info + +for i in /dp /sw /usr/X11R6 ; do + export PATH=$i/bin:$i/sbin:$PATH + export MANPATH=$i/share/man:$MANPATH + export INFOPATH=/$i/share/info:$INFOPATH +done + +typeset -gU PATH MANPATH INFOPATH diff --git a/user:hugues/Environment.zsh b/user:hugues/Environment.zsh index f532fe2..1670723 100644 --- a/user:hugues/Environment.zsh +++ b/user:hugues/Environment.zsh @@ -64,4 +64,6 @@ WATCH=notme WORDCHARS='*?-_~!#$%^' ## Caractères faisant partie des mots ## J'ai viré les '/()[]{}' +export SUDO_PROMPT="%u has to enter passwd to become %U: " + MUSICPLAYER=audacious @@ -14,6 +14,7 @@ # # If you want to make user, host or network specific configurations, # add your specific scripts to the folders +# - "sys:$(uname -s)" for OS-specific conf, # - "user:$(whoami)" for user-specific conf, # - "host:$(hostname -s)" for host-specific conf, # - "net:$(domainname)" for network-specific conf, @@ -28,6 +29,7 @@ mkdir -p $ZDOTDIR # Useful environment variables which may be used # at any time - We compute them now to avoid calling # the required processes each time we'll need. +OSNAME=`uname -s` USER=${USER:-`whoami`} UID=${UID:-`id -u`} HOST=$HOST:r @@ -49,15 +51,24 @@ if [ -d $ZDOTDIR ]; then for i in "net:$DOMAIN"\ "host:$HOST"\ + "sys:$OSNAME"\ "user:$USER"\ "user:$SUDO_USER"\ "net:$DOMAIN/host:$HOST"\ + "net:$DOMAIN/sys:$OSNAME"\ "net:$DOMAIN/user:$USER"\ "net:$DOMAIN/user:$SUDO_USER"\ + "net:$DOMAIN/host:$HOST/sys:$OSNAME"\ "net:$DOMAIN/host:$HOST/user:$USER"\ "net:$DOMAIN/host:$HOST/user:$SUDO_USER"\ + "net:$DOMAIN/host:$HOST/sys:$OSNAME"\ + "net:$DOMAIN/host:$HOST/sys:$OSNAME/user:$USER"\ + "net:$DOMAIN/host:$HOST/sys:$OSNAME/user:$SUDO_USER"\ + "host:$HOST/sys:$OSNAME"\ "host:$HOST/user:$USER"\ - "host:$HOST/user:$SUDO_USER" + "host:$HOST/user:$SUDO_USER"\ + "host:$HOST/sys:$OSNAME/user:$USER"\ + "host:$HOST/sys:$OSNAME/user:$SUDO_USER" do specific_script=${script:h}/$i/${${script:t}/??_/} if test -f $specific_script |