-
-
Notifications
You must be signed in to change notification settings - Fork 682
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(themes): add nekolight theme (#655)
Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
- Loading branch information
1 parent
569a6f5
commit e740d2a
Showing
4 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |