diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2017-02-14 23:42:41 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2017-02-14 23:42:41 +0300 |
commit | 875dec5dae69966e009237a3aa174b255158f01f (patch) | |
tree | 696317551c3e55011b90c6d1a880c4c656bb9038 /functions | |
parent | 674ae068b65bebb669e0cdd58db9f3e0413b0324 (diff) | |
parent | 04284abe14a8b578b1c3e824cf96f0a0768b9161 (diff) |
Merge branch 'next' into execution_time
Diffstat (limited to 'functions')
-rw-r--r-- | functions/icons.zsh | 3 | ||||
-rw-r--r-- | functions/utilities.zsh | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/functions/icons.zsh b/functions/icons.zsh index d8232f07..f0aec351 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -80,6 +80,7 @@ case $POWERLEVEL9K_MODE in PUBLIC_IP_ICON '' LOCK_ICON $'\UE138' # EXECUTION_TIME_ICON $'\UE89C' # + SSH_ICON '(ssh)' ) ;; 'awesome-fontconfig') @@ -142,6 +143,7 @@ case $POWERLEVEL9K_MODE in PUBLIC_IP_ICON '' LOCK_ICON $'\UE138' # EXECUTION_TIME_ICON $'\uF253' + SSH_ICON '(ssh)' ) ;; *) @@ -204,6 +206,7 @@ case $POWERLEVEL9K_MODE in PUBLIC_IP_ICON '' LOCK_ICON $'\UE0A2' EXECUTION_TIME_ICON 'Dur' + SSH_ICON '(ssh)' ) ;; esac diff --git a/functions/utilities.zsh b/functions/utilities.zsh index f27c7f99..22b53c6a 100644 --- a/functions/utilities.zsh +++ b/functions/utilities.zsh @@ -208,3 +208,19 @@ function truncatePathFromRight() { echo $1 | sed $SED_EXTENDED_REGEX_PARAMETER \ "s@(([^/]{$((POWERLEVEL9K_SHORTEN_DIR_LENGTH))})([^/]{$delim_len}))[^/]+/@\2$POWERLEVEL9K_SHORTEN_DELIMITER/@g" } + +# Search recursively in parent folders for given file. +function upsearch () { + if [[ "$PWD" == "$HOME" || "$PWD" == "/" ]]; then + echo "$PWD" + elif test -e "$1"; then + pushd .. > /dev/null + upsearch "$1" + popd > /dev/null + echo "$PWD" + else + pushd .. > /dev/null + upsearch "$1" + popd > /dev/null + fi +} |