summaryrefslogtreecommitdiff
path: root/wallpaper.fish
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-07 11:38:05 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-07 11:38:05 +1000
commitf9a83990a91e9b3ae694df53b64fe611520632a7 (patch)
treeb4992c9e7e7b0a04d9c7889f6b4b5f53d92ff4f9 /wallpaper.fish
parentschemes: cache schemes (diff)
downloadcaelestia-cli-f9a83990a91e9b3ae694df53b64fe611520632a7.tar.gz
caelestia-cli-f9a83990a91e9b3ae694df53b64fe611520632a7.tar.bz2
caelestia-cli-f9a83990a91e9b3ae694df53b64fe611520632a7.zip
scheme: better colours + parallel generation
Fix some wallpapers not having enough colours by disabling filter (also gives better colours) Use GNU parallel to run scheme generation in parallel Also ensure all schemes exist when generating Cache wallpaper thumbnails
Diffstat (limited to 'wallpaper.fish')
-rwxr-xr-xwallpaper.fish10
1 files changed, 4 insertions, 6 deletions
diff --git a/wallpaper.fish b/wallpaper.fish
index 1acb7ff..86fcb5c 100755
--- a/wallpaper.fish
+++ b/wallpaper.fish
@@ -107,13 +107,11 @@ else
hyprctl hyprpaper unload unused > /dev/null
# Thumbnail wallpaper for colour gen
- set -l thumb_path $C_CACHE/thumbnails/(string replace -a '/' '-' (dirname $chosen_wallpaper | string sub -s 2))-(path change-extension '.jpg' (basename $chosen_wallpaper))
- if test -f $thumb_path
- # Use thumbnail from shell
- cp $thumb_path $state_dir/thumbnail.jpg
- else
- magick -define jpeg:size=256x256 $chosen_wallpaper -thumbnail 128x128 $state_dir/thumbnail.jpg
+ set -l thumb_path $C_CACHE/thumbnails/(sha1sum $chosen_wallpaper | cut -d ' ' -f 1).jpg
+ if ! test -f $thumb_path
+ magick -define jpeg:size=256x256 $chosen_wallpaper -thumbnail 128x128 $thumb_path
end
+ cp $thumb_path $state_dir/thumbnail.jpg
# Generate colour scheme for wallpaper
set -l src (dirname (status filename))