Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions themes/THEMES.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@

[![](nekonight/nekonight-dark.jpg)](nekonight/nekonight-dark.jpg)

## `nekonight moon`

[![](nekonight_moon/nekonight-moon-dark.jpg)](nekonight_moon/nekonight-moon-dark.jpg)

## `nwinkler`

[![](nwinkler/nwinkler-dark.png)](nwinkler/nwinkler-dark.png)
Expand Down
33 changes: 33 additions & 0 deletions themes/nekonight/nekonight-base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
function _omb_theme_nekonight_git_prompt_info() {
local branch_name
branch_name=$(git symbolic-ref --short HEAD 2>&-)
local git_status=""

if [[ -n $branch_name ]]; then
git_status="${_omb_prompt_bold_white}(🐱 $branch_name $(_omb_theme_nekonight_scm_git_status))${_omb_prompt_normal}"
fi

echo -n "$git_status"
}

function _omb_theme_nekonight_scm_git_status() {
local git_status=""

if git rev-list --count --left-right @{upstream}...HEAD 2>&- | grep -Eq '^[0-9]+\s[0-9]+$'; then
git_status+="${_omb_prompt_brown}${_omb_prompt_normal} "
fi

if [[ -n $(git diff --cached --name-status 2>&-) ]]; then
git_status+="${_omb_prompt_green}+${_omb_prompt_normal}"
fi

if [[ -n $(git diff --name-status 2>&-) ]]; then
git_status+="${_omb_prompt_yellow}${_omb_prompt_normal}"
fi

if [[ -n $(git ls-files --others --exclude-standard 2>&-) ]]; then
git_status+="${_omb_prompt_red}${_omb_prompt_normal}"
fi

echo -n "$git_status"
}
43 changes: 7 additions & 36 deletions themes/nekonight/nekonight.theme.sh
Original file line number Diff line number Diff line change
@@ -1,55 +1,26 @@
# nekonight Bash prompt with source control management
# Author: Bruno Ciccarino <[email protected]>
#
#
# Theme inspired by:
# - Bash_it cupcake theme
# Demo:
# ╭─🐱 virtualenv 🐱user at 🐱host in 🐱directory on (🐱branch {1} ↑1 ↓1 +1 •1 ⌀1 ✗)
# ╰λ cd ~/path/to/your-directory

if [ -z "${NEKONIGHT_BASE_LOADED}" ]; then
source "$OSH/themes/nekonight/nekonight-base.sh"
export NEKONIGHT_BASE_LOADED=true
fi

icon_start="╭─"
icon_user=" 🐱 ${_omb_prompt_bold_olive}\u${_omb_prompt_normal}"
icon_host=" at 🐱 ${_omb_prompt_bold_cyan}\h${_omb_prompt_normal}"
icon_directory=" in 🐱 ${_omb_prompt_bold_magenta}\w${_omb_prompt_normal}"
icon_end="╰─${_omb_prompt_bold_white}λ${_omb_prompt_normal}"

function _omb_theme_nekonight_git_prompt_info() {
local branch_name
branch_name=$(git symbolic-ref --short HEAD 2>/dev/null)
local git_status=""

if [[ -n $branch_name ]]; then
git_status="${_omb_prompt_bold_white}(🐱 $branch_name $(_omb_theme_nekonight_scm_git_status))${_omb_prompt_normal}"
fi

echo -n "$git_status"
}

function _omb_theme_nekonight_scm_git_status() {
local git_status=""

if git rev-list --count --left-right @{upstream}...HEAD 2>/dev/null | grep -Eq '^[0-9]+\s[0-9]+$'; then
git_status+="${_omb_prompt_brown}${_omb_prompt_normal} "
fi

if [[ -n $(git diff --cached --name-status 2>/dev/null) ]]; then
git_status+="${_omb_prompt_green}+${_omb_prompt_normal}"
fi

if [[ -n $(git diff --name-status 2>/dev/null) ]]; then
git_status+="${_omb_prompt_yellow}${_omb_prompt_normal}"
fi

if [[ -n $(git ls-files --others --exclude-standard 2>/dev/null) ]]; then
git_status+="${_omb_prompt_red}${_omb_prompt_normal}"
fi

echo -n "$git_status"
}

function _omb_theme_PROMPT_COMMAND() {
local git_info=$(_omb_theme_nekonight_git_prompt_info)
PS1="${icon_start}${icon_user}${icon_host}${icon_directory} in $(_omb_theme_nekonight_git_prompt_info)\n${icon_end} "
}

_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND

Binary file added themes/nekonight_moon/nekonight-moon-dark.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions themes/nekonight_moon/nekonight_moon.theme.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# nekonight-moon Bash prompt with source control management
# Author: Bruno Ciccarino <[email protected]>
#
# Theme inspired by:
# - Bash_it cupcake theme
# Demo:
# ╭─🌙 virtualenv 🌙user at 🌙host in 🌙directory on (🌙branch {1} ↑1 ↓1 +1 •1 ⌀1 ✗)
# ╰λ cd ~/path/to/your-directory

if [ -z "${NEKONIGHT_BASE_LOADED}" ]; then
source "$OSH/themes/nekonight/nekonight-base.sh"
export NEKONIGHT_BASE_LOADED=true
fi

icon_start="╭─"
icon_user=" 🌙 ${_omb_prompt_bold_olive}\u${_omb_prompt_normal}"
icon_host=" at 🌙 ${_omb_prompt_bold_cyan}\h${_omb_prompt_normal}"
icon_directory=" in 🌙 ${_omb_prompt_bold_magenta}\w${_omb_prompt_normal}"
icon_end="╰─${_omb_prompt_bold_white}λ${_omb_prompt_normal}"

function _omb_theme_PROMPT_COMMAND() {
local git_info=$(_omb_theme_nekonight_git_prompt_info)
PS1="${icon_start}${icon_user}${icon_host}${icon_directory} in $(_omb_theme_nekonight_git_prompt_info)\n${icon_end} "
}

_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND


Loading