123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #!/bin/bash
- # Coding: utf-8
- # Editor: www.geany.org
- # Created 2016-12-18
- # for xfce4 desktop enviroment
- # xfconf-query --channel xfce4-desktop --property /backdrop/screen0/monitorVGA-1/workspace0/last-image --set "$(cat ~/LOG/,wallpaper_changer.sh/last_wallpaper)" for setup current wallpaper
- export DISPLAY=:0
- export XAUTHORITY=/home/a/.Xauthority
- export XDG_RUNTIME_DIR=/run/user/$(id -u)
- source $HOME/.SCR/lib.sh
- fun_log_dir_create $0 365
- con_test_not_exist_process
- dir_new="$HOME/DATA2/Wallpapers/new"
- dir_used="$HOME/DATA2/Wallpapers/used"
- last_wall_logfile="$dir_script/last_wallpaper"
- read last_wall_path < $last_wall_logfile
- fun_analize_command "Read wallpaper path from file"
- fun_create_directory "$dir_new" "$dir_used"
- if [ -d "$dir_new" ] # if folder with wallpaper exist
- then
- wall_name=`ls $dir_new | shuf -n 1`
- fun_analize_command "Get random wallpaper file path"
- new_wall_path="$dir_new/$wall_name"
- fun_echo_variable last_wall_path new_wall_path
- if [ -n "$new_wall_path" ] # if file exist
- then
- xfconf-query --channel xfce4-desktop --property /backdrop/screen0/monitorVGA-1/workspace0/last-image --set "$new_wall_path"
- fun_analize_command "Setup wallpaper $new_wall_path"
- if [ -s "$last_wall_path" ] # if last wallpaper path exist
- then
- if [ "$1" == "del" ] # if first argument is "del"
- then
- rm -rf "$last_wall_path"
- fun_analize_command "Delete file $last_wall_path"
- else
- touch "$last_wall_path"
- fun_analize_command "Set new time date to wallpaper file"
- mv "$last_wall_path" "$dir_used"
- fun_analize_command "Move file to folder $dir_used"
- fi
- fi
- echo "$new_wall_path" > $last_wall_logfile
- fun_analize_command "Write new wallpaper path to file"
- echo "$date_utc" > "${dir_general}/lockfile_wallpaper_changer"
- ,speech_en.sh "New wallpaper installed"
- else
- fun_echo_stadia 11 0 "Files to wallpaper not exist"
- fi
- else
- fun_echo_stadia 11 0 "Folder to wallpaper not exist"
- fi
|