Skip to content

Commit

Permalink
feat(themes): add nekolight theme (#655)
Browse files Browse the repository at this point in the history
Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
  • Loading branch information
BrunoCiccarino and akinomyoga authored Jan 27, 2025
1 parent 569a6f5 commit e740d2a
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
4 changes: 4 additions & 0 deletions themes/THEMES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
18 changes: 18 additions & 0 deletions themes/nekolight/README.md
Original file line number Diff line number Diff line change
@@ -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`.
Binary file added themes/nekolight/nekolight-dark.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions themes/nekolight/nekolight.theme.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e740d2a

Please sign in to comment.