You are not logged in.
I will attach the script i am trying to do.
It is setting the dir but it is not showing images in the preview box and not setting the interval to change the wallpaper.
I used duckduckgo AI to help write the script but it couldn't get me any further.
I was hoping someone here could help.
#!/usr/bin/env bash
set -euo pipefail
WALLPAPER_DIR="${HOME}/.config/variety/Downloaded"
INTERVAL_SECONDS=300
if [[ ! -d "$WALLPAPER_DIR" ]]; then
echo "Directory not found: $WALLPAPER_DIR" >&2
exit 1
fi
SAMPLE_IMAGE=$(find "$WALLPAPER_DIR" -maxdepth 2 -type f -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' | head -n1 || true)
if [[ -z "$SAMPLE_IMAGE" ]]; then
echo "No images found under: $WALLPAPER_DIR" >&2
exit 1
fi
WALLPAPER_URI="file://${WALLPAPER_DIR%/}"
SAMPLE_IMAGE_URI="file://${SAMPLE_IMAGE}"
INTERVAL_MS=$((INTERVAL_SECONDS * 1000))
JS='var all = desktops(); for (var i = 0; i < all.length; i++) { var d = all[i]; d.wallpaperPlugin = "org.kde.slideshow"; d.currentConfigGroup = ["Wallpaper","org.kde.slideshow","General"]; d.writeConfig("SlidePaths", ["'"$WALLPAPER_URI"'"]); d.writeConfig("Recursive", 1); d.writeConfig("Interval", '"$INTERVAL_MS"'); d.writeConfig("Image", "'"$SAMPLE_IMAGE_URI"'"); }'
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript "$(printf '%s' "$JS")"
killall plasmashell || true
kstart5 plasmashell &>/dev/null || true
echo "Set slideshow wallpaper folder to: $WALLPAPER_DIR"
echo "Sample image: $SAMPLE_IMAGE"
echo "Interval: ${INTERVAL_SECONDS}s"Offline