From 6866648ac65a8f18facbcc6c14985af8b5737d76 Mon Sep 17 00:00:00 2001 From: Titivoot Pangrit Date: Sat, 27 Feb 2021 21:17:13 +0300 Subject: [PATCH] Add theme Easy --- clean_files.txt | 1 + docs/themes-list/easy.rst | 14 ++++++++++++++ themes/easy/easy.theme.bash | 19 +++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 docs/themes-list/easy.rst create mode 100644 themes/easy/easy.theme.bash diff --git a/clean_files.txt b/clean_files.txt index 5cececcf..ad8b93f5 100644 --- a/clean_files.txt +++ b/clean_files.txt @@ -43,6 +43,7 @@ themes/bobby-python themes/brainy themes/brunton themes/command_duration.theme.bash +themes/easy themes/modern themes/purity diff --git a/docs/themes-list/easy.rst b/docs/themes-list/easy.rst new file mode 100644 index 00000000..cd553cf4 --- /dev/null +++ b/docs/themes-list/easy.rst @@ -0,0 +1,14 @@ +.. _easy: + +Easy Theme +========== + +A simple theme + +Examples +-------- + +.. code-block:: bash + + user@hostname ~/.bash_it + [ master ✓ ] ❯ diff --git a/themes/easy/easy.theme.bash b/themes/easy/easy.theme.bash new file mode 100644 index 00000000..a48eb824 --- /dev/null +++ b/themes/easy/easy.theme.bash @@ -0,0 +1,19 @@ +# shellcheck shell=bash + +SCM_THEME_PROMPT_PREFIX="${bold_green}[ ${normal}" +SCM_THEME_PROMPT_SUFFIX="${bold_green} ] " +SCM_THEME_PROMPT_DIRTY=" ${red}✗" +SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" + +prompt_command() { + if [ "$(whoami)" = root ]; then + cursor_color="${bold_red}" + user_color="${green}" + else + cursor_color="${bold_green}" + user_color="${white}" + fi + PS1="${user_color}\u${normal}@${white}\h ${bold_black}\w\n${reset_color}$(scm_prompt_info)${cursor_color}❯ ${normal}" +} + +safe_append_prompt_command prompt_command