Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.35 KB | None | 0 0
  1. "#!/bin/sh
  2.  
  3. time_now="$(date +%H)"
  4. imagedir="$HOME/.timeofday/"
  5. conky_file="$HOME/.conky/arch"
  6. color_day='333333'
  7. color_night='f1f1f1'
  8. chanel='xfce4-desktop'
  9. prop='/backdrop/screen0/monitorLVDS1/workspace0/last-image'
  10.  
  11.  
  12. if [ $time_now -ge 0 -a $time_now -le 3 ] ; then
  13.    image='08-Late-Night.png'
  14. elif [ $time_now -ge 4 -a $time_now -le 5 ]; then
  15.    image='01-Morning.png'
  16. elif [ $time_now -ge 6 -a $time_now -le 10 ]; then
  17.    image='02-Late-Morning.png'
  18. elif [ $time_now -ge 11 -a $time_now -le 14 ]; then
  19.    image='03-Afternoon.png'
  20. elif [ $time_now -ge 15 -a $time_now -le 16 ]; then
  21.    image='04-Late-Afternoon.png'
  22. elif [ $time_now -ge 17 -a $time_now -le 18 ]; then
  23.    image='06-Late-Evening.png'
  24. elif [ $time_now -ge 19 -a $time_now -le 23 ]; then
  25.    image='07-Night.png'
  26. fi
  27.  
  28. night_mode="$(grep $color_night $conky_file )"
  29.  
  30. if [ $time_now -ge 4 -a $time_now -le 16 ]; then
  31.    if [ -n "$night_mode" ] ; then
  32.        sed -i "s/$color_night/$color_day/g" $conky_file
  33.    fi
  34. else    
  35.    if [ -z "$night_mode" ] ; then
  36.        sed -i "s/$color_day/$color_night/g" $conky_file
  37.    fi
  38. fi
  39.  
  40. pid=$(ps -C xfce4-session -o pid= | tr -d \ )
  41. export $(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$pid/environ)
  42.  
  43. wallpaper_prop=$(xfconf-query -c "$chanel" -p "$prop")
  44.  
  45. if [ "${wallpaper_prop#image_dir}" != "$image" ]; then
  46.    xfconf-query -c "$chanel" -p "$prop" -s "$imagedir""$image"
  47. fi"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement