Compare commits
	
		
			6 Commits
		
	
	
		
			71f922de59
			...
			1e2354a092
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 1e2354a092 | |||
| f2210f3baa | |||
| 8e277a0a55 | |||
| bf9fd9c77c | |||
| a51ff516a0 | |||
| bd4a42425c | 
@@ -61,4 +61,7 @@ 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) - Pretty much all the base16 themes
 | 
			
		||||
- [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
 | 
			
		||||
    
 | 
			
		||||
							
								
								
									
										54
									
								
								base16/templates/better-discord.mustache
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								base16/templates/better-discord.mustache
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,54 @@
 | 
			
		||||
/**
 | 
			
		||||
* @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 "#{{base01}}"
 | 
			
		||||
bspc config active_border_color "#{{base04}}"
 | 
			
		||||
bspc config focused_border_color "#{{base0C}}"
 | 
			
		||||
bspc config normal_border_color "#{{base02}}"
 | 
			
		||||
bspc config active_border_color "#{{base03}}"
 | 
			
		||||
bspc config focused_border_color "#{{base04}}"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										18
									
								
								base16/templates/oomox-gtk-medium.mustache
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								base16/templates/oomox-gtk-medium.mustache
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
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
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										18
									
								
								base16/templates/oomox-gtk.mustache
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								base16/templates/oomox-gtk.mustache
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
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,6 +20,41 @@ 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"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										43
									
								
								shchemes
									
									
									
									
									
								
							
							
						
						
									
										43
									
								
								shchemes
									
									
									
									
									
								
							@@ -130,17 +130,18 @@ inject() {
 | 
			
		||||
	parse_scheme
 | 
			
		||||
	check_scheme_path
 | 
			
		||||
	parse_comment_pattern
 | 
			
		||||
	tmp=$(mktemp)
 | 
			
		||||
 | 
			
		||||
	if [ "$comment_start" == "" ]; then
 | 
			
		||||
	  comment_start="#"
 | 
			
		||||
	fi
 | 
			
		||||
	awk -i inplace \
 | 
			
		||||
		-v blockstart="${comment_start}START SHCHEMES BLOCK" \
 | 
			
		||||
	awk -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 {
 | 
			
		||||
@@ -153,39 +154,31 @@ $1 ~ blockstart {
 | 
			
		||||
	system("/usr/bin/env bash -c " sq "SCHEME=\"" scheme "\";" command sq);
 | 
			
		||||
	next
 | 
			
		||||
}
 | 
			
		||||
$1 ~ blockend {
 | 
			
		||||
$1 == blockend && inblock {
 | 
			
		||||
	inblock = 0;
 | 
			
		||||
	print;
 | 
			
		||||
	next
 | 
			
		||||
	print nl blockend commentend;
 | 
			
		||||
	next;
 | 
			
		||||
}
 | 
			
		||||
ENDFILE  {
 | 
			
		||||
    if(inblock) {
 | 
			
		||||
	    print blockend commentend;
 | 
			
		||||
    	print nl blockend commentend;
 | 
			
		||||
   		for(i=1;i<=bi;i++) {
 | 
			
		||||
   			print lines[i];
 | 
			
		||||
   		}
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
	' "$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"
 | 
			
		||||
	' "$path" > "$tmp" && mv "$tmp" "$path"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
convert_tinted_scheme() {
 | 
			
		||||
	path=$1
 | 
			
		||||
	tmp=$(mktemp)
 | 
			
		||||
	
 | 
			
		||||
	awk -i inplace -F ' *: *' '
 | 
			
		||||
	awk -F ' *: *' '
 | 
			
		||||
/^#/ { print }
 | 
			
		||||
$1 ~ "palette" { p = 1; next }
 | 
			
		||||
p && /^ +/ { gsub(/ /, "", $1); print $1 "=" $2 }
 | 
			
		||||
	' "$path"
 | 
			
		||||
	' "$path" > "$tmp" && mv -f "$tmp" "$path"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
install_tinted_scheme() {
 | 
			
		||||
@@ -216,11 +209,23 @@ 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" | convert_tinted_template > "${shchemes_dir}/base16/templates/${target}.mustache"
 | 
			
		||||
	curl "$url" > "$tmp"
 | 
			
		||||
	convert_tinted_template "$tmp" > "${shchemes_dir}/base16/templates/${target}.mustache"
 | 
			
		||||
	rm "$tmp"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
manual() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user