Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 25 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Update the repository with the latest base16 colorschemes
on:
schedule:
- cron: "0 0 * * 0" # https://crontab.guru/every-week
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install pybase16
run: pip install pybase16-builder
- name: Fetch the repository code
uses: actions/checkout@v2
- name: Run make
run: make
- name: Commit the changes, if any
uses: stefanzweifel/git-auto-commit-action@v4.1.1
with:
commit_message: Update repository with the latest base16 colorschemes
branch: ${{ github.head_ref }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sources
schemes
sources.yaml

templates/*

!/templates/config.yaml
!/templates/default.mustache
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Ref: https://github.com/fnune/base16-qutebrowser
.PHONY: all clean update build

BUILD=pybase16
REPO=$(shell pwd)
TEMPLATE=$(shell basename ${REPO})
THEME_DIR=scripts
TEMPLATE_DIR=templates
OUTPUT=output

all: update build

update:
$(BUILD) update

build:
$(BUILD) build -t ${REPO} -o ${OUTPUT}
rm -rf ${THEME_DIR}
mv ${OUTPUT}/${TEMPLATE}/${THEME_DIR}/ ${THEME_DIR}/

clean:
rm -rf ${OUTPUT} ${TEMPLATE_DIR}/*/
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Base16 Shell
See the [Base16 repository](https://github.com/chriskempson/base16) for more information.
These scripts were built with [Base16 Builder PHP](https://github.com/chriskempson/base16-builder-php).

See the [Base16 repository](https://github.com/chriskempson/base16) for more information.
These scripts were built with [base16-builder-python](https://github.com/InspectorMustache/base16-builder-python).

A shell script to change your shell's default ANSI colors but most importantly, colors 17 to 21 of your shell's 256 colorspace (if supported by your terminal). This script makes it possible to honor the original bright colors of your shell (e.g. bright green is still green and so on) while providing additional base16 colors to applications such as Vim.

![Base16 Shell](https://raw.github.com/chriskempson/base16-shell/master/base16-shell.png)

## Use Cases

* You want to use a `*.256.*` variant of a Terminal theme designed to honor the original bright colors.
* You prefer to use a script instead of a terminal emulator theme to color your shell.
* You use this script to have different colorschemes appear on different SSH sessions.
- You want to use a `*.256.*` variant of a Terminal theme designed to honor the original bright colors.
- You prefer to use a script instead of a terminal emulator theme to color your shell.
- You use this script to have different colorschemes appear on different SSH sessions.

## Installation

Expand Down Expand Up @@ -69,3 +70,24 @@ If **colortest** is run without any arguments e.g. `./colortest` the hex values

This is the expected behaviour when using a light theme:
https://github.com/chriskempson/base16-shell/issues/150

## Building

Dependencies:

- Python, at least version 3.5
- The `pybase16` command from [base16-builder-python](https://github.com/InspectorMustache/base16-builder-python)
- The `make` command

```
# Install dependencies (you probably already have pip/pip3 and make)
apt install build-essential # for make
pip3 install pybase16-builder

# Build the packages
make
```

### Keeping your themes up to date

To update, just `git pull` wherever you've cloned `base16-shell`. The themes are updated on a weekly basis thanks to GitHub Actions. See the GitHub Actions workflow in [`.github/workflows/update.yml`](.github/workflows/update.yml).
126 changes: 126 additions & 0 deletions scripts/base16-darkmoss.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
#!/bin/sh
# base16-shell (https://github.com/chriskempson/base16-shell)
# Base16 Shell template by Chris Kempson (http://chriskempson.com)
# darkmoss scheme by Gabriel Avanzi (https://github.com/avanzzzi)

color00="17/1e/1f" # Base 00 - Black
color01="ff/46/58" # Base 08 - Red
color02="49/91/80" # Base 0B - Green
color03="fd/b1/1f" # Base 0A - Yellow
color04="49/80/91" # Base 0D - Blue
color05="9b/c0/c8" # Base 0E - Magenta
color06="66/d9/ef" # Base 0C - Cyan
color07="c7/c7/a5" # Base 05 - White
color08="55/5e/5f" # Base 03 - Bright Black
color09=$color01 # Base 08 - Bright Red
color10=$color02 # Base 0B - Bright Green
color11=$color03 # Base 0A - Bright Yellow
color12=$color04 # Base 0D - Bright Blue
color13=$color05 # Base 0E - Bright Magenta
color14=$color06 # Base 0C - Bright Cyan
color15="e1/ea/ef" # Base 07 - Bright White
color16="e6/db/74" # Base 09
color17="d2/7b/53" # Base 0F
color18="25/2c/2d" # Base 01
color19="37/3c/3d" # Base 02
color20="81/8f/80" # Base 04
color21="e3/e3/c8" # Base 06
color_foreground="c7/c7/a5" # Base 05
color_background="17/1e/1f" # Base 00

if [ -n "$TMUX" ]; then
# Tell tmux to pass the escape sequences through
# (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324)
put_template() { printf '\033Ptmux;\033\033]4;%d;rgb:%s\033\033\\\033\\' $@; }
put_template_var() { printf '\033Ptmux;\033\033]%d;rgb:%s\033\033\\\033\\' $@; }
put_template_custom() { printf '\033Ptmux;\033\033]%s%s\033\033\\\033\\' $@; }
elif [ "${TERM%%[-.]*}" = "screen" ]; then
# GNU screen (screen, screen-256color, screen-256color-bce)
put_template() { printf '\033P\033]4;%d;rgb:%s\007\033\\' $@; }
put_template_var() { printf '\033P\033]%d;rgb:%s\007\033\\' $@; }
put_template_custom() { printf '\033P\033]%s%s\007\033\\' $@; }
elif [ "${TERM%%-*}" = "linux" ]; then
put_template() { [ $1 -lt 16 ] && printf "\e]P%x%s" $1 $(echo $2 | sed 's/\///g'); }
put_template_var() { true; }
put_template_custom() { true; }
else
put_template() { printf '\033]4;%d;rgb:%s\033\\' $@; }
put_template_var() { printf '\033]%d;rgb:%s\033\\' $@; }
put_template_custom() { printf '\033]%s%s\033\\' $@; }
fi

# 16 color space
put_template 0 $color00
put_template 1 $color01
put_template 2 $color02
put_template 3 $color03
put_template 4 $color04
put_template 5 $color05
put_template 6 $color06
put_template 7 $color07
put_template 8 $color08
put_template 9 $color09
put_template 10 $color10
put_template 11 $color11
put_template 12 $color12
put_template 13 $color13
put_template 14 $color14
put_template 15 $color15

# 256 color space
put_template 16 $color16
put_template 17 $color17
put_template 18 $color18
put_template 19 $color19
put_template 20 $color20
put_template 21 $color21

# foreground / background / cursor color
if [ -n "$ITERM_SESSION_ID" ]; then
# iTerm2 proprietary escape codes
put_template_custom Pg c7c7a5 # foreground
put_template_custom Ph 171e1f # background
put_template_custom Pi c7c7a5 # bold color
put_template_custom Pj 373c3d # selection color
put_template_custom Pk c7c7a5 # selected text color
put_template_custom Pl c7c7a5 # cursor
put_template_custom Pm 171e1f # cursor text
else
put_template_var 10 $color_foreground
if [ "$BASE16_SHELL_SET_BACKGROUND" != false ]; then
put_template_var 11 $color_background
if [ "${TERM%%-*}" = "rxvt" ]; then
put_template_var 708 $color_background # internal border (rxvt)
fi
fi
put_template_custom 12 ";7" # cursor (reverse video)
fi

# clean up
unset -f put_template
unset -f put_template_var
unset -f put_template_custom
unset color00
unset color01
unset color02
unset color03
unset color04
unset color05
unset color06
unset color07
unset color08
unset color09
unset color10
unset color11
unset color12
unset color13
unset color14
unset color15
unset color16
unset color17
unset color18
unset color19
unset color20
unset color21
unset color_foreground
unset color_background
126 changes: 126 additions & 0 deletions scripts/base16-darkviolet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
#!/bin/sh
# base16-shell (https://github.com/chriskempson/base16-shell)
# Base16 Shell template by Chris Kempson (http://chriskempson.com)
# Dark Violet scheme by ruler501 (https://github.com/ruler501/base16-darkviolet)

color00="00/00/00" # Base 00 - Black
color01="a8/2e/e6" # Base 08 - Red
color02="45/95/e6" # Base 0B - Green
color03="f2/9d/f2" # Base 0A - Yellow
color04="41/36/d9" # Base 0D - Blue
color05="7e/5c/e6" # Base 0E - Magenta
color06="40/df/ff" # Base 0C - Cyan
color07="b0/8a/e6" # Base 05 - White
color08="59/33/80" # Base 03 - Bright Black
color09=$color01 # Base 08 - Bright Red
color10=$color02 # Base 0B - Bright Green
color11=$color03 # Base 0A - Bright Yellow
color12=$color04 # Base 0D - Bright Blue
color13=$color05 # Base 0E - Bright Magenta
color14=$color06 # Base 0C - Bright Cyan
color15="a3/66/ff" # Base 07 - Bright White
color16="bb/66/cc" # Base 09
color17="a8/86/bf" # Base 0F
color18="23/1a/40" # Base 01
color19="43/2d/59" # Base 02
color20="00/ff/00" # Base 04
color21="90/45/e6" # Base 06
color_foreground="b0/8a/e6" # Base 05
color_background="00/00/00" # Base 00

if [ -n "$TMUX" ]; then
# Tell tmux to pass the escape sequences through
# (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324)
put_template() { printf '\033Ptmux;\033\033]4;%d;rgb:%s\033\033\\\033\\' $@; }
put_template_var() { printf '\033Ptmux;\033\033]%d;rgb:%s\033\033\\\033\\' $@; }
put_template_custom() { printf '\033Ptmux;\033\033]%s%s\033\033\\\033\\' $@; }
elif [ "${TERM%%[-.]*}" = "screen" ]; then
# GNU screen (screen, screen-256color, screen-256color-bce)
put_template() { printf '\033P\033]4;%d;rgb:%s\007\033\\' $@; }
put_template_var() { printf '\033P\033]%d;rgb:%s\007\033\\' $@; }
put_template_custom() { printf '\033P\033]%s%s\007\033\\' $@; }
elif [ "${TERM%%-*}" = "linux" ]; then
put_template() { [ $1 -lt 16 ] && printf "\e]P%x%s" $1 $(echo $2 | sed 's/\///g'); }
put_template_var() { true; }
put_template_custom() { true; }
else
put_template() { printf '\033]4;%d;rgb:%s\033\\' $@; }
put_template_var() { printf '\033]%d;rgb:%s\033\\' $@; }
put_template_custom() { printf '\033]%s%s\033\\' $@; }
fi

# 16 color space
put_template 0 $color00
put_template 1 $color01
put_template 2 $color02
put_template 3 $color03
put_template 4 $color04
put_template 5 $color05
put_template 6 $color06
put_template 7 $color07
put_template 8 $color08
put_template 9 $color09
put_template 10 $color10
put_template 11 $color11
put_template 12 $color12
put_template 13 $color13
put_template 14 $color14
put_template 15 $color15

# 256 color space
put_template 16 $color16
put_template 17 $color17
put_template 18 $color18
put_template 19 $color19
put_template 20 $color20
put_template 21 $color21

# foreground / background / cursor color
if [ -n "$ITERM_SESSION_ID" ]; then
# iTerm2 proprietary escape codes
put_template_custom Pg b08ae6 # foreground
put_template_custom Ph 000000 # background
put_template_custom Pi b08ae6 # bold color
put_template_custom Pj 432d59 # selection color
put_template_custom Pk b08ae6 # selected text color
put_template_custom Pl b08ae6 # cursor
put_template_custom Pm 000000 # cursor text
else
put_template_var 10 $color_foreground
if [ "$BASE16_SHELL_SET_BACKGROUND" != false ]; then
put_template_var 11 $color_background
if [ "${TERM%%-*}" = "rxvt" ]; then
put_template_var 708 $color_background # internal border (rxvt)
fi
fi
put_template_custom 12 ";7" # cursor (reverse video)
fi

# clean up
unset -f put_template
unset -f put_template_var
unset -f put_template_custom
unset color00
unset color01
unset color02
unset color03
unset color04
unset color05
unset color06
unset color07
unset color08
unset color09
unset color10
unset color11
unset color12
unset color13
unset color14
unset color15
unset color16
unset color17
unset color18
unset color19
unset color20
unset color21
unset color_foreground
unset color_background
Loading