>Linux is ugly
Oh yeah?
#!/bin/bash
# Function to set the background
set_background() {
feh --bg-fill "$1"
}
# Get current hour
hour=$(date +%H)
# Image directories
morning_dir="/path/to/your/images/morning"
afternoon_dir="/path/to/your/images/afternoon"
evening_dir="/path/to/your/images/evening"
night_dir="/path/to/your/images/night"
# Choose a random image from the appropriate directory
if [[ $hour -ge 6 && $hour -lt 12 ]]; then
image=$(ls "$morning_dir" | shuf -n1)
set_background "$morning_dir/$image"
elif [[ $hour -ge 12 && $hour -lt 18 ]]; then
image=$(ls "$afternoon_dir" | shuf -n1)
set_background "$afternoon_dir/$image"
elif [[ $hour -ge 18 && $hour -lt 22 ]]; then
image=$(ls "$evening_dir" | shuf -n1)
set_background "$evening_dir/$image"
else
image=$(ls "$night_dir" | shuf -n1)
set_background "$night_dir/$image"
fi