Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "#!/bin/sh
- time_now="$(date +%H)"
- imagedir="$HOME/.timeofday/"
- conky_file="$HOME/.conky/arch"
- color_day='333333'
- color_night='f1f1f1'
- chanel='xfce4-desktop'
- prop='/backdrop/screen0/monitorLVDS1/workspace0/last-image'
- if [ $time_now -ge 0 -a $time_now -le 3 ] ; then
- image='08-Late-Night.png'
- elif [ $time_now -ge 4 -a $time_now -le 5 ]; then
- image='01-Morning.png'
- elif [ $time_now -ge 6 -a $time_now -le 10 ]; then
- image='02-Late-Morning.png'
- elif [ $time_now -ge 11 -a $time_now -le 14 ]; then
- image='03-Afternoon.png'
- elif [ $time_now -ge 15 -a $time_now -le 16 ]; then
- image='04-Late-Afternoon.png'
- elif [ $time_now -ge 17 -a $time_now -le 18 ]; then
- image='06-Late-Evening.png'
- elif [ $time_now -ge 19 -a $time_now -le 23 ]; then
- image='07-Night.png'
- fi
- night_mode="$(grep $color_night $conky_file )"
- if [ $time_now -ge 4 -a $time_now -le 16 ]; then
- if [ -n "$night_mode" ] ; then
- sed -i "s/$color_night/$color_day/g" $conky_file
- fi
- else
- if [ -z "$night_mode" ] ; then
- sed -i "s/$color_day/$color_night/g" $conky_file
- fi
- fi
- pid=$(ps -C xfce4-session -o pid= | tr -d \ )
- export $(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$pid/environ)
- wallpaper_prop=$(xfconf-query -c "$chanel" -p "$prop")
- if [ "${wallpaper_prop#image_dir}" != "$image" ]; then
- xfconf-query -c "$chanel" -p "$prop" -s "$imagedir""$image"
- fi"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement