From 9188fba3b14c331744b8593138f9496adea4ea60 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Sun, 6 Nov 2016 02:44:21 +0100 Subject: zsh: Use the ZSH prompt system for prompt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- zsh/.zshrc | 4 ++- zsh/prompt.zsh | 67 ------------------------------------------ zsh/themes/prompt_kyrias_setup | 39 ++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 68 deletions(-) delete mode 100644 zsh/prompt.zsh create mode 100644 zsh/themes/prompt_kyrias_setup (limited to 'zsh') diff --git a/zsh/.zshrc b/zsh/.zshrc index 4ed147d..4e21f7e 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -2,6 +2,7 @@ HISTFILE=~/.config/zsh/.zsh_history HISTSIZE=500000 SAVEHIST=500000 +fpath+=("$XDG_CONFIG_HOME/zsh/themes") zstyle :compinstall filename "$ZDOTDIR"/.zshrc # Menu completion @@ -42,7 +43,6 @@ zmodload zsh/mapfile source "$ZDOTDIR"/keybindings.zsh source "$ZDOTDIR"/aliases.zsh # aliases and functions. -source "$ZDOTDIR"/prompt.zsh # sets the prompt if [[ -n "$VTE_VERSION" ]]; then source /etc/profile.d/vte.sh @@ -55,3 +55,5 @@ fi GPG_TTY=$(tty) export GPG_TTY + +prompt kyrias diff --git a/zsh/prompt.zsh b/zsh/prompt.zsh deleted file mode 100644 index c83b2da..0000000 --- a/zsh/prompt.zsh +++ /dev/null @@ -1,67 +0,0 @@ -# Red -bg[light_pink]='%K{001}' -bg[light_red]='%K{196}' -bg[red]='%K{88}' -bg[dark_red]='%K{52}' - -fg[light_pink]='%F{001}' -fg[light_red]='%F{196}' -fg[red]='%F{88}' -fg[dark_red]='%F{52}' - - -# Yellow -bg[light_gold]='%K{136}' -bg[gold]='%K{139}' -bg[dark_gold]='%K{94}' - -fg[light_gold]='%F{136}' -fg[gold]='%F{139}' -fg[dark_gold]='%F{94}' - - -# Blue -bg[light_blue]='%K{blue}' -bg[blue]='%K{21}' - -fg[light_blue]='%F{blue}' -fg[blue]='%F{21}' - - -# Green -bg[dark_green]='%K{64}' - -function virtualenv_prompt { - if [[ -n "$VIRTUAL_ENV" ]]; then - print "$bg[light_blue]$fg[white] $(basename $VIRTUAL_ENV) %f%k" - fi -} - -if (( UID == 0 )); then - PROMPT='$bg[light_red] $fg[white]%m%f %k$bg[white]$fg[light_red] %~ %f%k$(virtualenv_prompt) -$bg[light_blue] λ %k ' - -else - case $SHORTHOST in - "theos") - PROMPT='$bg[light_pink] $fg[white]%m%f %k$bg[white]$fg[light_pink] %~ %f%k$(virtualenv_prompt) -$bg[light_blue] λ %k ' - ;; - - "lucifer") - PROMPT='$bg[dark_gold] $fg[white]%m%f %k$bg[white]$fg[dark_gold] %~ %f%k$(virtualenv_prompt) -$bg[light_blue] λ %k ' - ;; - - "nymeria") - PROMPT='$bg[dark_green] $fg[white]%m%f %k$bg[white]$fg[dark_gold] %~ %f%k$(virtualenv_prompt) -$bg[light_blue] λ %k ' - ;; - - *) - PROMPT='$bg[black] $fg[white]%m%f %k$bg[white]$fg[black] %~ %f%k$(virtualenv_prompt) -$bg[light_blue] λ %k ' - ;; - - esac -fi diff --git a/zsh/themes/prompt_kyrias_setup b/zsh/themes/prompt_kyrias_setup new file mode 100644 index 0000000..68dbfd8 --- /dev/null +++ b/zsh/themes/prompt_kyrias_setup @@ -0,0 +1,39 @@ +prompt_kyrias_help() { + cat <