Regenerated

This commit is contained in:
2026-03-29 13:50:57 +00:00
parent 85e28303be
commit 604c6bbcb4
5 changed files with 294 additions and 318 deletions
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail
PICTURES_DIR="$HOME/Wallpapers/pictures"
# -----------------------------
# Get list of images
# -----------------------------
mapfile -t IMAGES < <(find "$PICTURES_DIR" -type f \( -iname '*.png' -o -iname '*.jpg' -o -iname '*.jpeg' \))
if [ "${#IMAGES[@]}" -eq 0 ]; then
echo "No images found in $PICTURES_DIR"
exit 1
fi
# -----------------------------
# Set a random wallpaper per workspace
# -----------------------------
WORKSPACES=$(hyprctl workspaces -j | jq -r '.[].id')
for ws in $WORKSPACES; do
RAND_IMAGE="${IMAGES[RANDOM % ${#IMAGES[@]}]}"
echo "Setting wallpaper for workspace $ws: $RAND_IMAGE"
# Set wallpaper for workspace
swww img "$RAND_IMAGE" --resize fit --transition-type random --namespace "$ws"
done
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -euo pipefail
# Determine repo root dynamically
repoRoot="$(dirname "$(readlink -f "$0")")/../.."
wallpaperSrc="$repoRoot/assets/Wallpapers"
wallpaperDst="$HOME/Wallpapers"
mkdir -p "$wallpaperDst"
# 2-way sync (add only, overwrite if newer, never delete)
rsync -au --ignore-existing "$wallpaperSrc/" "$wallpaperDst/"
rsync -tu "$wallpaperDst/" "$wallpaperSrc/"
# Gather wallpapers
mapfile -t wallpapers < <(find "$wallpaperDst" -type f)
numWallpapers=${#wallpapers[@]}
if [[ $numWallpapers -eq 0 ]]; then
echo "No wallpapers found in $wallpaperDst"
exit 1
fi
# Check if a workspace ID is passed
if [[ $# -eq 1 ]]; then
ws="$1"
randomIndex=$(( RANDOM % numWallpapers ))
swww img "${wallpapers[$randomIndex]}" --transition-fade 1 --workspace "$ws"
else
# Full refresh for all workspaces
workspaces=$(hyprctl workspaces -j | jq -r '.[].id')
for ws in $workspaces; do
randomIndex=$(( RANDOM % numWallpapers ))
swww img "${wallpapers[$randomIndex]}" --transition-fade 1 --workspace "$ws"
done
fi
@@ -0,0 +1,6 @@
#!/bin/sh
pgrep swww >/dev/null 2>&1 || swww &
mkdir -p ~/Wallpapers
rsync -au --ignore-existing ../ ~/
rsync -au ../ ~/
#bash ./set-wallpapers-at-logon.sh