Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
961 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #!/bin/sh
  2. hour=$(date +"%-H")
  3. morning=6
  4. afternoon=12
  5. night=19
  6. cached=$(cat "$XDG_RUNTIME_DIR"/day_cache)
  7. if [ "$hour" -le "$morning" ]; then
  8. if [ ! "$cached" = "night" ]; then
  9. feh --no-fehbg --bg-fill "$(find ~/.local/backgrounds/evening | sort -R | tail -1 )"
  10. echo "night" > "$XDG_RUNTIME_DIR/day_cache"
  11. fi
  12. elif [ "$night" -le "$hour" ]; then
  13. if [ ! "$cached" = "night" ]; then
  14. feh --no-fehbg --bg-fill "$(find ~/.local/backgrounds/evening | sort -R | tail -1 )"
  15. echo "night" > "$XDG_RUNTIME_DIR/day_cache"
  16. fi
  17. elif [ "$afternoon" -le "$hour" ]; then
  18. if [ ! "$cached" = "afternoon" ]; then
  19. feh --no-fehbg --bg-fill "$(find ~/.local/backgrounds/afternoon| sort -R | tail -1 )"
  20. echo "afternoon" > "$XDG_RUNTIME_DIR/day_cache"
  21. fi
  22. else
  23. if [ ! "$cached" = "morning" ]; then
  24. feh --no-fehbg --bg-fill "$(find ~/.local/backgrounds/morning | sort -R | tail -1 )"
  25. echo "morning" > "$XDG_RUNTIME_DIR/day_cache"
  26. fi
  27. fi