Powerline prompt in majaro zsh

Use this script for zsh, but the prompt changes back to the standard manjaro prompt. How to fix this, should i delete all the lines above neofetch ?

# Use powerline
USE_POWERLINE="true"
# Source manjaro-zsh-configuration
if [[ -e /usr/share/zsh/manjaro-zsh-config ]]; then
  source /usr/share/zsh/manjaro-zsh-config
fi
# Use manjaro zsh prompt
if [[ -e /usr/share/zsh/manjaro-zsh-prompt ]]; then
  source /usr/share/zsh/manjaro-zsh-prompt
fi

neofetch

function powerline_precmd() {
    PS1="$(powerline-shell --shell zsh $?)"
}

function install_powerline_precmd() {
  for s in "${precmd_functions[@]}"; do
    if [ "$s" = "powerline_precmd" ]; then
      return
    fi
  done
  precmd_functions+=(powerline_precmd)
}

if [ "$TERM" != "linux" -a -x "$(command -v powerline-shell)" ]; then
    install_powerline_precmd
fi

I suggest you try commenting the lines and see what happens :slight_smile:

Hi @MGrider,

Compare it against the regular .zshrc, which can be found in /etc/skel:

# Use powerline
USE_POWERLINE="true"
# Source manjaro-zsh-configuration
if [[ -e /usr/share/zsh/manjaro-zsh-config ]]; then
  source /usr/share/zsh/manjaro-zsh-config
fi
# Use manjaro zsh prompt
if [[ -e /usr/share/zsh/manjaro-zsh-prompt ]]; then
   source /usr/share/zsh/manjaro-zsh-prompt
fi

So, according to me, you’d have to remove all line below:

neofetch

Which makes sense, I guess. Since files are parsed from top to bottom, so the lower lines override the higher ones.

Hope this helps!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.