From e6f7191cc1a770748805f78766822e603aa18738 Mon Sep 17 00:00:00 2001 From: xero Date: Thu, 1 Jan 2015 21:17:07 -0500 Subject: combine zsh user and root themes and files. install root theme with [sudo stow zsh -t /root] --- zsh/.zsh/functions/prompt_git_info | 4 ++-- zsh/.zshrc | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) (limited to 'zsh') diff --git a/zsh/.zsh/functions/prompt_git_info b/zsh/.zsh/functions/prompt_git_info index d492ac8..d6d3acb 100644 --- a/zsh/.zsh/functions/prompt_git_info +++ b/zsh/.zsh/functions/prompt_git_info @@ -1,5 +1,5 @@ if [ -n "$__CURRENT_GIT_BRANCH" ]; then - local s="%F{cyan}-[%F{white}" + local s="${USER_LEVEL}-[%F{white}" s+="$__CURRENT_GIT_BRANCH" case "$__CURRENT_GIT_BRANCH_STATUS" in ahead) @@ -15,7 +15,7 @@ if [ -n "$__CURRENT_GIT_BRANCH" ]; then if [ -n "$__CURRENT_GIT_BRANCH_IS_DIRTY" ]; then s+="⚡" fi - s+="%F{cyan}]" + s+="${USER_LEVEL}]" printf "%s%s" $s fi \ No newline at end of file diff --git a/zsh/.zshrc b/zsh/.zshrc index 7b454d3..6bba78b 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -127,6 +127,14 @@ zstyle ':completion:*' verbose true zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd' + +#█▓▒░ colors for permissions +if [[ "$EUID" -ne "0" ]] ; then # if user is not root + USER_LEVEL="%F{cyan}" +else # root! + USER_LEVEL="%F{red}" +fi + #█▓▒░ allow functions in the prompt setopt PROMPT_SUBST @@ -159,16 +167,16 @@ setopt SHARE_HISTORY #█▓▒░ custom prompts #█▓▒░dual line -PROMPT="%F{cyan}┌[%F{white}%n@%M%F{cyan}]─[%F{red}%~%F{cyan}] -%F{cyan}└─ %F{white}" -#RPROMPT="%F{cyan}[%F{white}%n@%M%F{cyan}]" +PROMPT="${USER_LEVEL}┌[%F{white}%n@%M${USER_LEVEL}]─[%F{white}%~${USER_LEVEL}] +${USER_LEVEL}└─ %F{white}" +#RPROMPT="${USER_LEVEL}[%F{white}%n@%M${USER_LEVEL}]" #█▓▒░ ninja -PROMPT="%F{white} ▟▙ %F{red}%~%F{white} -▟▒%F{blue}░░░░░░░%F{white}▜▙▜████████████████████████████████▛ -▜▒%F{blue}░░░░░░░%F{white}▟▛▟▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▛ +PROMPT="%F{white} ▟▙ ${USER_LEVEL}%~%F{white} +▟▒${USER_LEVEL}░░░░░░░%F{white}▜▙▜████████████████████████████████▛ +▜▒${USER_LEVEL}░░░░░░░%F{white}▟▛▟▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▛ ▜▛ %F{white}" #█▓▒░ minial -PROMPT='%F{cyan}[%F{white}%~%F{cyan}]$(prompt_git_info)── -%f ' +PROMPT='${USER_LEVEL}[%F{white}%~${USER_LEVEL}]$(prompt_git_info)── -%f ' -- cgit v1.2.1