Compare commits
No commits in common. "1e2354a0926ed9fc9b7ed5a68589be382d4b6575" and "71f922de5918eca1c47cee031e026cf381dedc29" have entirely different histories.
1e2354a092
...
71f922de59
@ -61,7 +61,4 @@ You can read the manual [in your browser](./doc/manual.md) or by running `shchem
|
||||
This software is a work of opportunism
|
||||
|
||||
- [mo](https://github.com/tests-always-included/mo) - Mustache templates in bash. Shchemes wouldn't be possible without it.
|
||||
- [tinted-theming/schemes](https://github.com/tinted-theming/schemes) - Several base16 themes
|
||||
- [deathbeam/base16-discord](https://github.com/deathbeam/base16-discord) - The base16 `better-discord` target
|
||||
- [mk12/base16-kitty](https://github.com/mk12/base16-kitty) - The base16 `kitty` target
|
||||
|
||||
- [tinted-theming/schemes](https://github.com/tinted-theming/schemes) - Pretty much all the base16 themes
|
||||
|
@ -1,54 +0,0 @@
|
||||
/**
|
||||
* @name base16 {{scheme-name}}
|
||||
* @author {{scheme-author}}
|
||||
* @version 1.0.0
|
||||
* @description base16 {{scheme-name}} theme generated from https://github.com/tinted-theming/schemes
|
||||
**/
|
||||
|
||||
:root {
|
||||
--base00: #{{base00}}; /* Black */
|
||||
--base01: #{{base01}}; /* Bright Black */
|
||||
--base02: #{{base02}}; /* Grey */
|
||||
--base03: #{{base03}}; /* Brighter Grey */
|
||||
--base04: #{{base04}}; /* Bright Grey */
|
||||
--base05: #{{base05}}; /* White */
|
||||
--base06: #{{base06}}; /* Brighter White */
|
||||
--base07: #{{base07}}; /* Bright White */
|
||||
--base08: #{{base08}}; /* Red */
|
||||
--base09: #{{base09}}; /* Orange */
|
||||
--base0A: #{{base0A}}; /* Yellow */
|
||||
--base0B: #{{base0B}}; /* Green */
|
||||
--base0C: #{{base0C}}; /* Cyan */
|
||||
--base0D: #{{base0D}}; /* Blue */
|
||||
--base0E: #{{base0E}}; /* Purple */
|
||||
--base0F: #{{base0F}}; /* Magenta */
|
||||
|
||||
--primary-630: var(--base00); /* Autocomplete background */
|
||||
--primary-660: var(--base00); /* Search input background */
|
||||
}
|
||||
|
||||
.theme-light, .theme-dark {
|
||||
--search-popout-option-fade: none; /* Disable fade for search popout */
|
||||
--bg-overlay-2: var(--base00); /* These 2 are needed for proper threads coloring */
|
||||
--home-background: var(--base00);
|
||||
--background-primary: var(--base00);
|
||||
--background-secondary: var(--base01);
|
||||
--background-secondary-alt: var(--base01);
|
||||
--channeltextarea-background: var(--base01);
|
||||
--background-tertiary: var(--base00);
|
||||
--background-accent: var(--base0E);
|
||||
--background-floating: var(--base01);
|
||||
--background-modifier-selected: var(--base00);
|
||||
--text-normal: var(--base05);
|
||||
--text-secondary: var(--base00);
|
||||
--text-muted: var(--base03);
|
||||
--text-link: var(--base0C);
|
||||
--interactive-normal: var(--base05);
|
||||
--interactive-hover: var(--base0C);
|
||||
--interactive-active: var(--base0A);
|
||||
--interactive-muted: var(--base03);
|
||||
--header-primary: var(--base06);
|
||||
--header-secondary: var(--base03);
|
||||
--scrollbar-thin-track: transparent;
|
||||
--scrollbar-auto-track: transparent;
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
bspc config normal_border_color "#{{base02}}"
|
||||
bspc config active_border_color "#{{base03}}"
|
||||
bspc config focused_border_color "#{{base04}}"
|
||||
bspc config normal_border_color "#{{base01}}"
|
||||
bspc config active_border_color "#{{base04}}"
|
||||
bspc config focused_border_color "#{{base0C}}"
|
||||
|
@ -1,18 +0,0 @@
|
||||
BG={{base05}}
|
||||
FG={{base00}}
|
||||
HDR_BG={{base04}}
|
||||
HDR_FG={{base01}}
|
||||
SEL_BG={{base00}}
|
||||
SEL_FG={{base0D}}
|
||||
TXT_BG={{base06}}
|
||||
TXT_FG={{base01}}
|
||||
BTN_BG={{base03}}
|
||||
BTN_FG={{base07}}
|
||||
HDR_BTN_BG={{base05}}
|
||||
HDR_BTN_FG={{base01}}
|
||||
WM_BORDER_FOCUS={{base0D}}
|
||||
WM_BORDER_UNFOCUS={{base04}}
|
||||
GRADIENT=0.0
|
||||
ROUNDNESS=2
|
||||
SPACING=3
|
||||
|
@ -1,18 +0,0 @@
|
||||
BG={{base00}}
|
||||
FG={{base05}}
|
||||
HDR_BG={{base01}}
|
||||
HDR_FG={{base04}}
|
||||
SEL_BG={{base0D}}
|
||||
SEL_FG={{base00}}
|
||||
TXT_BG={{base01}}
|
||||
TXT_FG={{base06}}
|
||||
BTN_BG={{base02}}
|
||||
BTN_FG={{base07}}
|
||||
HDR_BTN_BG={{base05}}
|
||||
HDR_BTN_FG={{base01}}
|
||||
WM_BORDER_FOCUS={{base0D}}
|
||||
WM_BORDER_UNFOCUS={{base04}}
|
||||
GRADIENT=0.0
|
||||
ROUNDNESS=2
|
||||
SPACING=3
|
||||
|
@ -20,41 +20,6 @@ rgb_b() {
|
||||
printf "$((0x${MO_FUNCTION_ARGS[0]:4:4}))"
|
||||
}
|
||||
|
||||
rgb() {
|
||||
rgb_r; printf " "
|
||||
rgb_g; printf " "
|
||||
rgb_b; printf " "
|
||||
}
|
||||
|
||||
clamp() {
|
||||
if [[ $1 -lt 0 ]]; then
|
||||
printf "0"
|
||||
else
|
||||
if [[ $1 -gt 255 ]]; then
|
||||
printf "255"
|
||||
else
|
||||
printf "%s" "$1"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
lighten() {
|
||||
mod="${MO_FUNCTION_ARGS[1]}"
|
||||
parts=("$(rgb_r)" "$(rgb_g)" "$(rgb_b)")
|
||||
vars=""
|
||||
for part in "${parts[@]}"; do
|
||||
let var=$part+$mod
|
||||
vars=$vars"$(clamp "$var") "
|
||||
done
|
||||
|
||||
printf "%02x%02x%02x" $vars
|
||||
}
|
||||
|
||||
darken() {
|
||||
MO_FUNCTION_ARGS[1]="-${MO_FUNCTION_ARGS[1]}"
|
||||
lighten
|
||||
}
|
||||
|
||||
set -a # All variables after this will be exported
|
||||
source $SCHEME
|
||||
mo "$TEMPLATE"
|
||||
|
55
shchemes
55
shchemes
@ -130,18 +130,17 @@ inject() {
|
||||
parse_scheme
|
||||
check_scheme_path
|
||||
parse_comment_pattern
|
||||
tmp=$(mktemp)
|
||||
|
||||
if [ "$comment_start" == "" ]; then
|
||||
comment_start="#"
|
||||
fi
|
||||
awk -v blockstart="${comment_start}START SHCHEMES BLOCK" \
|
||||
awk -i inplace \
|
||||
-v blockstart="${comment_start}START SHCHEMES BLOCK" \
|
||||
-v blockend="${comment_start}END SHCHEMES BLOCK" \
|
||||
-v commentend="$comment_end" \
|
||||
-v scheme="$scheme" \
|
||||
-v shchemes="$shchemes_path" \
|
||||
-v sq="'" \
|
||||
-v nl="\n" \
|
||||
-F ":" '
|
||||
!inblock { print }
|
||||
inblock {
|
||||
@ -154,31 +153,39 @@ $1 ~ blockstart {
|
||||
system("/usr/bin/env bash -c " sq "SCHEME=\"" scheme "\";" command sq);
|
||||
next
|
||||
}
|
||||
$1 == blockend && inblock {
|
||||
$1 ~ blockend {
|
||||
inblock = 0;
|
||||
print nl blockend commentend;
|
||||
next;
|
||||
print;
|
||||
next
|
||||
}
|
||||
ENDFILE {
|
||||
if(inblock) {
|
||||
print nl blockend commentend;
|
||||
for(i=1;i<=bi;i++) {
|
||||
print lines[i];
|
||||
}
|
||||
}
|
||||
ENDFILE {
|
||||
if(inblock) {
|
||||
print blockend commentend;
|
||||
for(i=1;i<=bi;i++) {
|
||||
print lines[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
' "$path" > "$tmp" && mv "$tmp" "$path"
|
||||
' "$path"
|
||||
}
|
||||
|
||||
convert_tinted_template() {
|
||||
path=$1
|
||||
sed -r \
|
||||
-e 's/\{\{base([0-9A-F]+)-hex\}\}/{{base\1}}/' \
|
||||
-e 's/\{\{base([0-9A-F]+)-rgb-r\}\}/{{rgb_r base\1}}/' \
|
||||
-e 's/\{\{base([0-9A-F]+)-rgb-g\}\}/{{rgb_g base\1}}/' \
|
||||
-e 's/\{\{base([0-9A-F]+)-rgb-b\}\}/{{rgb_b base\1}}/' "$path"
|
||||
}
|
||||
|
||||
convert_tinted_scheme() {
|
||||
path=$1
|
||||
tmp=$(mktemp)
|
||||
|
||||
awk -F ' *: *' '
|
||||
awk -i inplace -F ' *: *' '
|
||||
/^#/ { print }
|
||||
$1 ~ "palette" { p = 1; next }
|
||||
p && /^ +/ { gsub(/ /, "", $1); print $1 "=" $2 }
|
||||
' "$path" > "$tmp" && mv -f "$tmp" "$path"
|
||||
' "$path"
|
||||
}
|
||||
|
||||
install_tinted_scheme() {
|
||||
@ -209,23 +216,11 @@ install_tinted_scheme() {
|
||||
echo "Installed ${scheme}"
|
||||
}
|
||||
|
||||
convert_tinted_template() {
|
||||
path=$1
|
||||
sed -r \
|
||||
-e 's/\{\{base([0-9A-F]+)-hex\}\}/{{base\1}}/' \
|
||||
-e 's/\{\{base([0-9A-F]+)-rgb-r\}\}/{{rgb_r base\1}}/' \
|
||||
-e 's/\{\{base([0-9A-F]+)-rgb-g\}\}/{{rgb_g base\1}}/' \
|
||||
-e 's/\{\{base([0-9A-F]+)-rgb-b\}\}/{{rgb_b base\1}}/' "$path"
|
||||
}
|
||||
|
||||
install_tinted_template() {
|
||||
url=$1
|
||||
target=$2
|
||||
tmp=$(mktemp)
|
||||
|
||||
curl "$url" > "$tmp"
|
||||
convert_tinted_template "$tmp" > "${shchemes_dir}/base16/templates/${target}.mustache"
|
||||
rm "$tmp"
|
||||
curl "$url" | convert_tinted_template > "${shchemes_dir}/base16/templates/${target}.mustache"
|
||||
}
|
||||
|
||||
manual() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user