diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-03-08 22:25:51 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-03-08 22:25:51 +1100 |
| commit | 08af99b57d246fffb7bd58f31d52ecd13716558f (patch) | |
| tree | 5504891bb11b46491f58417ca8f9cce023d59b18 /scheme/gen-scheme.fish | |
| parent | scheme: allow choosing material scheme (diff) | |
| download | caelestia-cli-08af99b57d246fffb7bd58f31d52ecd13716558f.tar.gz caelestia-cli-08af99b57d246fffb7bd58f31d52ecd13716558f.tar.bz2 caelestia-cli-08af99b57d246fffb7bd58f31d52ecd13716558f.zip | |
scheme: optimise dynamic scheme gen
Make material schemes flavours of dynamic instead
Remove dynamic-scheme subcommand
Optimise scheme generation
Diffstat (limited to 'scheme/gen-scheme.fish')
| -rwxr-xr-x | scheme/gen-scheme.fish | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/scheme/gen-scheme.fish b/scheme/gen-scheme.fish index 7ac0d0e..4e82882 100755 --- a/scheme/gen-scheme.fish +++ b/scheme/gen-scheme.fish @@ -4,18 +4,27 @@ set -l src (dirname (status filename)) . $src/../util.fish -test -f "$argv[1]" && set -l img "$argv[1]" || set -l img $C_STATE/wallpaper/current -set -l img (realpath $img) +test -f "$argv[1]" && set -l img (realpath "$argv[1]") || set -l img $C_STATE/wallpaper/thumbnail.jpg contains -- "$argv[2]" light dark && set -l theme $argv[2] || set -l theme dark -test -n "$argv[3]" && set -l scheme $argv[3] || set -l scheme (cat $C_STATE/scheme/dynamic-scheme.txt 2> /dev/null || echo 'vibrant') + +set -l variants vibrant tonalspot expressive fidelity fruitsalad rainbow neutral content # Generate colours -if test $scheme = 'monochrome' - $src/autoadjust.py $theme $scheme (okolors $img -k 14) -else - test $theme = light && set -l lightness 50 || set -l lightness 70 - $src/autoadjust.py $theme $scheme (okolors $img -k 14 -w 0 -l $lightness) +test $theme = light && set -l lightness 50 || set -l lightness 70 +set -l colours (okolors $img -k 14 -w 0 -l $lightness) +for variant in $variants + mkdir -p $src/../data/schemes/dynamic/$variant + $src/autoadjust.py $theme $variant $colours > $src/../data/schemes/dynamic/$variant/$theme.txt end +mkdir -p $src/../data/schemes/dynamic/monochrome +$src/autoadjust.py $theme monochrome (okolors $img -k 14) > $src/../data/schemes/dynamic/monochrome/$theme.txt + +set -la variants monochrome # Generate layers and accents -$src/genmaterial.py $img $theme $scheme | head -c -1 # Trim trailing newline +set -l tmp (mktemp) +$src/genmaterial.py $img $theme > $tmp +for variant in $variants + grep -FA 15 $variant $tmp | tail -15 | head -c -1 >> $src/../data/schemes/dynamic/$variant/$theme.txt +end +rm $tmp |