From 41059a5b152f400474dbdd59a18581675b078e86 Mon Sep 17 00:00:00 2001 From: 1pav <60271007+1pav@users.noreply.github.com> Date: Fri, 24 Jan 2020 22:58:52 +0100 Subject: [PATCH] Port of Oh My Zsh's Bira theme --- themes/bira/README.md | 8 ++++++++ themes/bira/bira.theme.bash | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 themes/bira/README.md create mode 100644 themes/bira/bira.theme.bash diff --git a/themes/bira/README.md b/themes/bira/README.md new file mode 100644 index 00000000..2438778e --- /dev/null +++ b/themes/bira/README.md @@ -0,0 +1,8 @@ +# Bira + +This is a port of Oh My Zsh's ['Bira'](https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/bira.zsh-theme) theme. It looks the same as the original, except for the following changes: + +- Exit code of last command is not shown +- More informative git prompt (if you want to keep it minimal, please read: https://github.com/Bash-it/bash-it#git-prompt) +- Position and colour of virtualenv prompt +- No ruby version prompt diff --git a/themes/bira/bira.theme.bash b/themes/bira/bira.theme.bash new file mode 100644 index 00000000..ad1db5c6 --- /dev/null +++ b/themes/bira/bira.theme.bash @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +SCM_THEME_PROMPT_PREFIX=" ${yellow}‹" +SCM_THEME_PROMPT_SUFFIX="›${reset_color}" + +VIRTUALENV_THEME_PROMPT_PREFIX=" ${cyan}‹" +VIRTUALENV_THEME_PROMPT_SUFFIX="›${reset_color}" + +bold="\[\e[1m\]" + +if [ ${UID} -eq 0 ]; then + user_host="${bold_red}\u@\h${normal}${reset_color}" +else + user_host="${bold_green}\u@\h${normal}${reset_color}" +fi + +function prompt_command() { + local current_dir=" ${bold_blue}\w${normal}${reset_color}" + PS1="╭─${user_host}${current_dir}$(virtualenv_prompt)$(scm_prompt_info)\n╰─${bold}\\$ ${normal}" +} + +safe_append_prompt_command prompt_command