Regenerated

This commit is contained in:
2026-04-29 15:11:02 +02:00
parent 3106055e4b
commit ebb03eb278
6 changed files with 405 additions and 472 deletions
@@ -1,54 +0,0 @@
#!/run/current-system/sw/bin/bash
set -euo pipefail
WALLPAPER_DIR="$HOME/Wallpapers/pictures"
echo "Wallpaper dir = $WALLPAPER_DIR"
randomize_and_rename_wallpapers() {
echo "Randomizing JPG filenames..."
shopt -s nullglob
# Grab all jpg/JPG files
files=("$WALLPAPER_DIR"/*.[jJ][pP][gG])
if [ ${#files[@]} -eq 0 ]; then
echo "No JPG files found in $WALLPAPER_DIR"
return
fi
# Shuffle the array
mapfile -t files < <(printf "%s\n" "${files[@]}" | shuf)
tmp_names=()
for file in "${files[@]}"; do
ext="${file##*.}"
# generate a random 16-character alphanumeric name
while : ; do
rand_name=$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c16)
new_path="$WALLPAPER_DIR/$rand_name.$ext"
if [[ ! -e "$new_path" ]]; then
mv "$file" "$new_path"
tmp_names+=("$new_path")
echo "Renamed $file -> $new_path"
break
fi
done
done
# Sequentially rename to 01.jpg ... 99.jpg
counter=1
for file in "${tmp_names[@]}"; do
new_name=$(printf "%02d.jpg" "$counter")
mv "$file" "$WALLPAPER_DIR/$new_name"
echo "Final rename $file -> $WALLPAPER_DIR/$new_name"
((counter++))
[[ $counter -gt 99 ]] && break
done
echo "Randomization complete."
}
randomize_and_rename_wallpapers
@@ -1,13 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
SOCK="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
exec socat -U - UNIX-CONNECT:"$SOCK" | while IFS= read -r line; do
case "$line" in
workspace\>\>*)
WS="${line#workspace>>}"
"$HOME/Wallpapers/scripts/ws-wallpaper.sh" "$WS"
;;
esac
done