diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-22 17:49:44 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-22 17:49:44 +1000 |
| commit | ce6fdf0ab9e113f02fd41744e2176d5c3b538c48 (patch) | |
| tree | 1f416c5025ba54de8544818d9da6e5d771b7749f /wallpaper.fish | |
| parent | install: spicetify install marketplace (diff) | |
| download | caelestia-cli-ce6fdf0ab9e113f02fd41744e2176d5c3b538c48.tar.gz caelestia-cli-ce6fdf0ab9e113f02fd41744e2176d5c3b538c48.tar.bz2 caelestia-cli-ce6fdf0ab9e113f02fd41744e2176d5c3b538c48.zip | |
feat: up to 3 options for dynamic scheme
Have up to 3 options for base colour for dynamic scheme
Variants moved to new command
Also remove parallel dependency
Diffstat (limited to 'wallpaper.fish')
| -rwxr-xr-x | wallpaper.fish | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/wallpaper.fish b/wallpaper.fish index 37563bc..d41add3 100755 --- a/wallpaper.fish +++ b/wallpaper.fish @@ -114,24 +114,15 @@ else end cp $thumb_path $state_dir/thumbnail.jpg + # Light/dark mode detection if not specified + if ! set -q _flag_T + set -l lightness (magick $state_dir/thumbnail.jpg -format '%[fx:int(mean*100)]' info:) + test $lightness -ge 60 && set _flag_T light || set _flag_T dark + end + # Generate colour scheme for wallpaper set -l src (dirname (status filename)) - $src/scheme/gen-scheme.fish $state_dir/thumbnail.jpg dark & - $src/scheme/gen-scheme.fish $state_dir/thumbnail.jpg light & - if test -f $C_STATE/scheme/current-name.txt - set -l variant (string match -gr 'dynamic-(.*)' (cat $C_STATE/scheme/current-name.txt)) - if test -n "$variant" - # Light/dark mode detection if not specified - if ! set -q _flag_T - set -l lightness (magick $state_dir/thumbnail.jpg -format '%[fx:int(mean*100)]' info:) - test $lightness -ge 60 && set _flag_T light || set _flag_T dark - end - # Wait for async scheme gen to finish - wait - # Apply scheme - caelestia scheme dynamic $variant $_flag_T > /dev/null - end - end + MODE=$_flag_T $src/scheme/gen-scheme.fish & # Store the wallpaper chosen mkdir -p $state_dir |