Skip to content

Commit

Permalink
themes: Add a new theme "copied-duru" (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga authored Nov 26, 2024
2 parents abe4a3a + f64d324 commit 0186949
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 4 deletions.
4 changes: 4 additions & 0 deletions themes/THEMES.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@

[![](cooperkid/cooperkid-dark.png)](cooperkid/cooperkid-dark.png)

## `copied-duru`

[![](copied-duru/copied-duru-dark.png)](copied-duru/copied-duru-dark.png)

## `cupcake`

[![](cupcake/cupcake-dark.png)](cupcake/cupcake-dark.png)
Expand Down
16 changes: 16 additions & 0 deletions themes/copied-duru/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copied-Duru Theme

This theme is heavily inspired by the "Sexy" and "Duru" themes. The goal was to combine the color scheme of "Sexy" with the style of "Duru", and that is exactly what this theme achieves!

## Features

- **Colorful Prompt:** Utilizes the vibrant color scheme from the "Sexy" theme.
- **Informative Prompt:** Displays useful information such as the current time, user, host, current directory, Git branch, and Python virtual environment.

## Usage

- **Python Virtual Environment**Displayed in magenta
- **User and Host:** Displayed in purple and white
- **Current Time:** Displayed in Yellow
- **Current Directory:** Displayed in purple
- **Git Branch** Displayed in magenta
Binary file added themes/copied-duru/copied-duru-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions themes/copied-duru/copied-duru.theme.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#! bash oh-my-bash.module
# "Copied-Duru" Prompt, inspired by "Sexy" and obviously "Duru"

source "$OSH/themes/sexy/sexy.theme.sh"

if [[ $COLORTERM == gnome-* && $TERM == xterm ]] && infocmp gnome-256color &>/dev/null; then
export TERM=gnome-256color
elif [[ $TERM != dumb ]] && infocmp xterm-256color &>/dev/null; then
export TERM=xterm-256color
fi

function _omb_theme_PROMPT_COMMAND {
local current_time='\D{%H:%M:%S}'
local python_venv=
local just_a_format=' '$MAGENTA'(%s)'

if [[ $VIRTUAL_ENV ]]; then
printf -v python_venv "$just_a_format" "${VIRTUAL_ENV##*/}"
elif [[ $CONDA_DEFAULT_ENV ]]; then
printf -v python_venv "$just_a_format" "${CONDA_DEFAULT_ENV##*/}"
fi

local git_prefix=
[[ $(_omb_prompt_git branch 2> /dev/null) ]] && git_prefix=' on '

PS1=$GREEN'#'$python_venv' '$PURPLE'\u@'$WHITE'\h'$GREEN
PS1+=' '$current_time'>'$RESET
PS1+=' '$PURPLE'<\w'$WHITE$git_prefix$MAGENTA$(parse_git_branch)
PS1+=$PURPLE'>'$RESET'\n'$GREEN'$ '$RESET
}

_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
10 changes: 6 additions & 4 deletions themes/sexy/sexy.theme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Screenshot: http://cloud.gf3.ca/M5rG
# A big thanks to \amethyst on Freenode

if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color &>/dev/null; then
if [[ $COLORTERM == gnome-* && $TERM == xterm ]] && infocmp gnome-256color &>/dev/null; then
export TERM=gnome-256color
elif [[ $TERM != dumb ]] && infocmp xterm-256color &>/dev/null; then
export TERM=xterm-256color
Expand Down Expand Up @@ -36,9 +36,11 @@ function parse_git_branch {
function _omb_theme_PROMPT_COMMAND() {
local python_venv
_omb_prompt_get_python_venv
local git_prefix
git_prefix=$([[ -n $(_omb_prompt_git branch 2> /dev/null) ]] && _omb_util_print ' on ')
PS1="$python_venv${MAGENTA}\u ${WHITE}at ${ORANGE}\h ${WHITE}in ${GREEN}\w${WHITE}$git_prefix${PURPLE}\$(parse_git_branch)${WHITE}\n\$ ${RESET}"
local git_prefix=
[[ $(_omb_prompt_git branch 2> /dev/null) ]] && git_prefix=' on '
PS1=$python_venv$MAGENTA'\u '$WHITE'at '$ORANGE'\h'
PS1+=' '$WHITE'in '$GREEN'\w'$WHITE
PS1+=$git_prefix$PURPLE'$(parse_git_branch)'$WHITE'\n\$ '$RESET
}

_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND

0 comments on commit 0186949

Please sign in to comment.