diff --git a/themes/THEMES.md b/themes/THEMES.md index 749b44ee2..1e306634e 100644 --- a/themes/THEMES.md +++ b/themes/THEMES.md @@ -171,6 +171,10 @@ [![](n0qorg/n0qorg-dark.png)](n0qorg/n0qorg-dark.png) +## `nekolight` + +[![](nekolight/nekolight-dark.jpg)](nekolight/nekolight-dark.jpg) + ## `nekonight` [![](nekonight/nekonight-dark.jpg)](nekonight/nekonight-dark.jpg) diff --git a/themes/nekolight/README.md b/themes/nekolight/README.md new file mode 100644 index 000000000..15adc1ab9 --- /dev/null +++ b/themes/nekolight/README.md @@ -0,0 +1,18 @@ +# NekoLight prompt theme + +Nekolight is an Oh-My-Bash prompt theme inspired by Starship and designed to be simple and lightweight. + +![Nekolight theme](nekolight-dark.jpg) + +## 🚀 Installation + +Prerequisites +- A Nerd Font or Powerline Font installed and enabled in your terminal (for example, try the FiraCode Nerd Font). + +After installing the Nerd Fonts font, just modify the following line in your ~/.bashrc + +```shell +OSH_THEME="nekolight" +``` + +and then to load the theme in your terminal you must type `source ~/.bashrc`. diff --git a/themes/nekolight/nekolight-dark.jpg b/themes/nekolight/nekolight-dark.jpg new file mode 100644 index 000000000..70310d9e9 Binary files /dev/null and b/themes/nekolight/nekolight-dark.jpg differ diff --git a/themes/nekolight/nekolight.theme.sh b/themes/nekolight/nekolight.theme.sh new file mode 100644 index 000000000..d2bffcb98 --- /dev/null +++ b/themes/nekolight/nekolight.theme.sh @@ -0,0 +1,25 @@ +#! bash oh-my-bash.module + +_omb_theme_nekolight_version='1.0.0' +_omb_theme_nekolight_symbol="" + +function _omb_theme_nekolight_git_info() { + if _omb_prompt_git rev-parse --is-inside-work-tree &>/dev/null; then + local branch=$(_omb_prompt_git symbolic-ref --short HEAD 2>/dev/null || _omb_prompt_git rev-parse --short HEAD 2>/dev/null) + + if _omb_prompt_git diff --quiet 2>/dev/null && _omb_prompt_git diff --cached --quiet 2>/dev/null; then + _omb_util_print "on ${_omb_prompt_bold_green} ${_omb_theme_nekolight_symbol} ${branch} ${_omb_prompt_normal}" + else + _omb_util_print "on ${_omb_prompt_bold_red} ${_omb_theme_nekolight_symbol} ${branch}${_omb_prompt_normal}" + fi + fi +} + +function _omb_theme_PROMPT_COMMAND() { + local display_dir="${_omb_prompt_bold_blue}\w${_omb_prompt_normal}" + local git_status=$(_omb_theme_nekolight_git_info) + + PS1="${display_dir} ${git_status}\n❯ " +} + +_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND