Advertisement
Guest User

8bitday

a guest
Dec 18th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.69 KB | None | 0 0
  1. #!/bin/bash
  2. # Change the wallpaper according to time of day
  3.  
  4. TIME=$(date +"%H")
  5. FOLDER='/home/alecz/8BitDay'
  6. BGCMD='nitrogen --set-zoom-fill'
  7. export DISPLAY=:0  # run "env | grep DISPLAY"
  8.  
  9. case ${TIME} in
  10.     0[5-7])         $BGCMD "${FOLDER}/2 - Morning.png" ;;
  11.     0[8-9]|10)      $BGCMD "${FOLDER}/3 - Late Morning.png" ;;
  12.     1[1-3])         $BGCMD "${FOLDER}/4 - Afternoon.png" ;;
  13.     1[4-6])         $BGCMD "${FOLDER}/5 - Late Afternoon.png" ;;
  14.     1[7-9]|20)      $BGCMD "${FOLDER}/6 - Evening.png" ;;
  15.     21)             $BGCMD "${FOLDER}/7 - Late Evening.png" ;;
  16.     2[2-3])         $BGCMD "${FOLDER}/8 - Night.png" ;;
  17.     0[0-4])         $BGCMD "${FOLDER}/9 - Late Night.png" ;;
  18. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement