From ccf512b8ad6595fedab23953a93951cd97cd8f9e Mon Sep 17 00:00:00 2001 From: Dignity <107360076+77Dignity@users.noreply.github.com> Date: Thu, 17 Jul 2025 20:44:56 +0200 Subject: [PATCH 1/2] fix random konachan script not updating wallpaper --- .../quickshell/ii/scripts/colors/random_konachan_wall.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.config/quickshell/ii/scripts/colors/random_konachan_wall.sh b/.config/quickshell/ii/scripts/colors/random_konachan_wall.sh index 079cad96e..9b0fc4cfd 100755 --- a/.config/quickshell/ii/scripts/colors/random_konachan_wall.sh +++ b/.config/quickshell/ii/scripts/colors/random_konachan_wall.sh @@ -14,6 +14,11 @@ page=$((1 + RANDOM % 1000)); response=$(curl "https://konachan.com/post.json?tags=rating%3Asafe&limit=1&page=$page") link=$(echo "$response" | jq '.[0].file_url' -r); ext=$(echo "$link" | awk -F. '{print $NF}') -downloadPath="$HOME/Pictures/Wallpapers/konachan_random_image.$ext" +downloadPath="$HOME/Pictures/Wallpapers/konachan_random_image-0.$ext" +counter=0 +while [ -e $downloadPath ]; do + counter=$((counter + 1)) + downloadPath="$HOME/Pictures/Wallpapers/konachan_random_image-$counter.$ext" +done curl "$link" -o "$downloadPath" "$SCRIPT_DIR/switchwall.sh" --image "$downloadPath" From 084508db844b5467e5ce76451b31599bfb986380 Mon Sep 17 00:00:00 2001 From: Dignity <107360076+77Dignity@users.noreply.github.com> Date: Sat, 19 Jul 2025 19:24:49 +0200 Subject: [PATCH 2/2] use different filename if already used by config --- .../ii/scripts/colors/random_konachan_wall.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.config/quickshell/ii/scripts/colors/random_konachan_wall.sh b/.config/quickshell/ii/scripts/colors/random_konachan_wall.sh index a3843e0e9..1d146de46 100755 --- a/.config/quickshell/ii/scripts/colors/random_konachan_wall.sh +++ b/.config/quickshell/ii/scripts/colors/random_konachan_wall.sh @@ -14,11 +14,11 @@ page=$((1 + RANDOM % 1000)); response=$(curl "https://konachan.net/post.json?tags=rating%3Asafe&limit=1&page=$page") link=$(echo "$response" | jq '.[0].file_url' -r); ext=$(echo "$link" | awk -F. '{print $NF}') -downloadPath="$HOME/Pictures/Wallpapers/konachan_random_image-0.$ext" -counter=0 -while [ -e $downloadPath ]; do - counter=$((counter + 1)) - downloadPath="$HOME/Pictures/Wallpapers/konachan_random_image-$counter.$ext" -done +downloadPath="$HOME/Pictures/Wallpapers/konachan_random_image.$ext" +illogicalImpulseConfigPath="$HOME/.config/illogical-impulse/config.json" +currentWallpaperPath=$(jq -r '.background.wallpaperPath' $illogicalImpulseConfigPath) +if [ "$downloadPath" == "$currentWallpaperPath" ]; then + downloadPath="$HOME/Pictures/Wallpapers/konachan_random_image-1.$ext" +fi curl "$link" -o "$downloadPath" "$SCRIPT_DIR/switchwall.sh" --image "$downloadPath"