update command to use tr

This commit is contained in:
sudacode 2025-05-01 21:17:54 -07:00
parent 6640664a69
commit 04a1729781
Signed by: sudacode
SSH Key Fingerprint: SHA256:lT5C2bB398DcX6daCF/gYFNSTK3y+Du3oTGUnYzfTEw

View File

@ -16,7 +16,7 @@ CURRENT_WALL=$(hyprctl hyprpaper listloaded)
# Get a random wallpaper that is not the current one # Get a random wallpaper that is not the current one
WALLPAPER=$(find "$WALLPAPER_DIR" -type f ! -name "$(basename "$CURRENT_WALL")" ! -name "*.json" | shuf -n 1) WALLPAPER=$(find "$WALLPAPER_DIR" -type f ! -name "$(basename "$CURRENT_WALL")" ! -name "*.json" | shuf -n 1)
# remove double slashes that's there for some reason # remove double slashes that's there for some reason
WALLPAPER="${WALLPAPER//\/\///}" WALLPAPER=$(printf "%s" "$WALLPAPER" | tr -s '/')
echo "Changing wallpaper to $WALLPAPER" echo "Changing wallpaper to $WALLPAPER"
echo "$WALLPAPER" > "$HOME/.wallpaper" echo "$WALLPAPER" > "$HOME/.wallpaper"