From bdfa31f9d50482111f487e8a191eea1f9db030ec Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Wed, 31 Oct 2018 14:23:30 -0400 Subject: [PATCH] cleanup, fix bug with prompt --- files/.config/zsh/custom/000-env.zsh | 18 ------------------ files/.config/zsh/custom/200-motd.zsh | 4 +--- .../zsh/custom/config/neofetch-splash.bash | 13 ------------- .../.config/zsh/custom/themes/custom.zsh-theme | 4 +++- 4 files changed, 4 insertions(+), 35 deletions(-) delete mode 100644 files/.config/zsh/custom/config/neofetch-splash.bash diff --git a/files/.config/zsh/custom/000-env.zsh b/files/.config/zsh/custom/000-env.zsh index b142e06..382e9c7 100644 --- a/files/.config/zsh/custom/000-env.zsh +++ b/files/.config/zsh/custom/000-env.zsh @@ -1,24 +1,6 @@ # make word splitting behave like bash setopt SH_WORD_SPLIT -# Evaluate if root user -if uname -s | egrep -q '^(CYGWIN)|(MINGW)|(MSYS)'; then - #windows - if id -G | grep -q 544; then - IS_ROOT=true - else - IS_ROOT=false - fi -else - #'nix - if [[ $UID -eq 0 ]]; then - IS_ROOT=true - else - IS_ROOT=false - fi -fi -export IS_ROOT - # gpg-agent export GPG_TTY=$(tty) gpg-connect-agent updatestartuptty /bye >/dev/null diff --git a/files/.config/zsh/custom/200-motd.zsh b/files/.config/zsh/custom/200-motd.zsh index fbcecbe..d5ef984 100644 --- a/files/.config/zsh/custom/200-motd.zsh +++ b/files/.config/zsh/custom/200-motd.zsh @@ -1,4 +1,2 @@ -if [ "$IS_ROOT" = false ]; then - motd -fi +motd diff --git a/files/.config/zsh/custom/config/neofetch-splash.bash b/files/.config/zsh/custom/config/neofetch-splash.bash deleted file mode 100644 index 6ab1358..0000000 --- a/files/.config/zsh/custom/config/neofetch-splash.bash +++ /dev/null @@ -1,13 +0,0 @@ -ascii_distro="arch_small" - -print_info () { - info line_break - - info "OS" distro - info "Shell" shell - info "Kernel" kernel - - info line_break - - info "Packages" packages "$update_msg" -} diff --git a/files/.config/zsh/custom/themes/custom.zsh-theme b/files/.config/zsh/custom/themes/custom.zsh-theme index 924aefd..b47694d 100644 --- a/files/.config/zsh/custom/themes/custom.zsh-theme +++ b/files/.config/zsh/custom/themes/custom.zsh-theme @@ -61,7 +61,9 @@ prompt_cmd() { local wd_base="${PWD/$HOME/~}" local wd_post=$(echo "$wd_base" | grep -Eo '(^~|/[^/]+){1,4}$') local wd_pre=$(echo "${wd_base/$wd_post/}" | grep -Eo '^~|/[^/]{2}' | tr -d '\n' ) - local wd="%{$fg[yellow]%}$wd_pre$wd_post" + local wd="$wd_pre$wd_post" + [[ "$wd" == "" ]] && wd="/" + wd="%{$fg[yellow]%}$wd" # prompt if __is_root; then