Eu tenho um script e quando o executo, ele retorna
Directory not found: ~/Pictures/Wallpaper
O roteiro é o seguinte:
#!/bin/bash
# Check if the wallpaper directory exists
if [ ! -d "$WALLPAPER_DIR" ]; then
echo "Directory not found: $WALLPAPER_DIR"
exit 1
fi
# Get currently loaded wallpaper
CURRENT_WALL=$(hyprctl hyprpaper listloaded)
# Get a random wallpaper that is not the current one
IMAGE=$(find "$WALLPAPER_DIR" -type f ! -name "$(basename "$CURRENT_WALL")" | -iname "*.jpg" -o -iname "*.png" -o -iname "*.jpeg" | shuf -n 1)
# Verify that an image was found
if [ -z "$IMAGE" ]; then
echo "No images found in $WALLPAPER_DIR"
exit 1
fi
A $WALLPAPER_DIR
variável de ambiente está configurada no meu arquivo hyprland.conf e tem o valor ~/Pictures/Wallpaper que eu verifiquei.
Estou bastante perplexo sobre o motivo de ele estar retornando o negativo da instrução if quando a variável e a pasta de fato existem.