Thank you pebcak and manuel for your guidance. I suspected as much that I am gonna need the autostart file of openbox. That is how EndeavourOS/Openbox “restores” the wallpaper when the user logs in. It’s just that I wanted all the “config” for the wallpaper setup to be at one place but anyway this is what I ended up doing:
The rand-wall service and timer files are as they are in ~/.config/systemd/user. I enable the timer with systemctl --user enable --now rand-wall.timer. It will take care of changing the wallpaper every hour.
Now for setting the wallpaper every time I log in, I go to ~/.config/openbox/ and edit the autostart file as:
# Wallpaper
# nitrogen --restore &
nitrogen --set-zoom-fill --random '/path/to/wallpapers/' &
Now,
- A random wallpaper is set every time I log in.
- A random wallpaper is set every 1 hour.