Compare commits

..

No commits in common. "45fd2e35d5f1bb8ed85f77372bbba2690474b489" and "81df6aaa8f5f3c8cea4e762833aca7f80f3cc83a" have entirely different histories.

3 changed files with 8 additions and 41 deletions

View file

@ -1,9 +0,0 @@
#!/bin/bash
echo "Write 'yes do as i say' to confirm that you REALLY want to do this: $@"
read
if [[ "${REPLY,,}" = "yes do as i say" ]]
then
eval $@
else
echo "aborting"
fi

View file

@ -1,9 +0,0 @@
#!/bin/bash
echo "To be executed: $@"
read -p "Confirm (Y/N): " -n 1 -r
case "$REPLY" in
y|Y ) echo "es"; eval $@;;
n|N ) echo "o";;
* ) echo -e "\ninvalid";;
esac

View file

@ -1,28 +1,13 @@
#!/bin/bash #!/bin/bash
date='date +%Y-%m-%d\ %T' date='date +%Y-%m-%d\ %T'
logfile=~/.wkgen.log logfile=~/.wkgen.log
prepath="${XDG_PICTURES_DIR:=$HOME/Pictures}" filelocation=/home/plex/Pictures/wallpaper/wk-progress.1.png
mkdir -p "$prepath/wallpaper"
filelocation="$prepath/wallpaper/wk-progress.1.png"
set -e set -e
oldhash="$(sha256sum $filelocation || echo none)"
echo "[$(eval $date)]: starting webrequests..." | tee -a $logfile echo "[$(eval $date)]: starting webrequests..." | tee -a $logfile
curl -s -o $filelocation -A "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36" -o "wallpaper.png" "http://wkw.natural20design.com/?k=7b98a684-5c91-44ab-86b1-f7023609fe4e&d=1" curl -s -o $filelocation "https://wkgen.homeserver.box/?k=7b98a684-5c91-44ab-86b1-f7023609fe4e&d=1"
newhash="$(sha256sum $filelocation)" echo "[$(eval $date)]: setting wallpaper..." | tee -a $logfile
echo -e "\tnew:\t$newhash\n\told:\t$oldhash" kwriteconfig5 \
if [[ "$oldhash" = "$newhash" ]]; then --file "$HOME/.config/plasma-org.kde.plasma.desktop-appletsrc" \
echo "same files, nothing to do" --group 'Containments' --group '1' --group 'Wallpaper' --group 'org.kde.image' \
exit --group 'General' --key 'Image' $filelocation
else echo "[$(eval $date)]: done" | tee -a $logfile
echo "[$(eval $date)]: setting wallpaper..." | tee -a $logfile
dbus-send --session --dest=org.kde.plasmashell --type=method_call \
/PlasmaShell org.kde.PlasmaShell.evaluateScript 'string:
var Desktops = desktops();
for (i=0;i<Desktops.length;i++) {
d = Desktops[i];
d.wallpaperPlugin = "org.kde.image";
d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General");
d.writeConfig("Image", "file://'$filelocation'");
}'
echo "[$(eval $date)]: done" | tee -a $logfile
fi