From 84fad656ab0fb76fc0ab955185c91e0c284a00c1 Mon Sep 17 00:00:00 2001 From: Quinn Date: Tue, 15 Jul 2025 21:46:31 +0200 Subject: [PATCH] set the output directory to static due to cronnie problems --- usr/bin/satalite-wp-update | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/usr/bin/satalite-wp-update b/usr/bin/satalite-wp-update index 308c24c..92df3b8 100755 --- a/usr/bin/satalite-wp-update +++ b/usr/bin/satalite-wp-update @@ -4,6 +4,7 @@ # set -xv EUMETSAT_KEY="jdBM1PsDQUm0tCZfk9VXD6IaJoUa" EUMETSAT_SECRET="SumkiqFMU3MAGpt_azb1KXKgjdMa" +OUTDIR="$HOME/photos/eumetsat" error() { printf "\033[31m%s\033[0m\n" "$1" @@ -13,15 +14,6 @@ error() { # verify internet ping -c1 1.1.1.1 >>/dev/null || error "couldn't establish an internet connection!" -# acquire the output directory -if command -v xdg-user-dir; then - outdir="$(xdg-user-dir PICTURES)/eumetsat" -elif [ -z "$HOME" ]; then - outdir="$HOME/.eumetsat" -else - error "couldn't connect to either 'xdg-user-dir PICTURES' or '\$HOME'" -fi - # acquire the API key key=$( curl -k -d "grant_type=client_credentials" \ @@ -44,9 +36,9 @@ url+="&format=image/png" url+="&access_token=$key" # process incoming data -[ ! -d "$outdir" ] && { mkdir -p "$outdir" || error "failed to access '$outdir'!"; } -curl "$url" -o "$outdir/tmp.png" || error "failed to download from url='$url'!" -mv -f "$outdir/tmp.png" "$outdir/curr.png" +[ ! -d "$OUTDIR" ] && { mkdir -p "$OUTDIR" || error "failed to access '$OUTDIR'!"; } +curl "$url" -o "$OUTDIR/tmp.png" || error "failed to download from url='$url'!" +mv -f "$OUTDIR/tmp.png" "$OUTDIR/curr.png" # update the feh background . "$HOME/.fehbg"