diff --git a/.local/share/scripts/reddit-wp.sh b/.local/share/scripts/reddit-wp.sh index 70aae7a..ea98ba0 100755 --- a/.local/share/scripts/reddit-wp.sh +++ b/.local/share/scripts/reddit-wp.sh @@ -6,7 +6,7 @@ set -e # There are 2 subreddits "wallpapers" and "wallpaper" the 2nd one is bigger. +SUB="${1:-wallpaper}" -# wget -O - "http://www.reddit.com/r/wallpapers/top/.json?t=day" 2> /dev/null | jq -r ".data.children[0].data.url" +wget -O - "http://www.reddit.com/r/$SUB/top/.json?t=day" 2> /dev/null | jq -r ".data.children[0].data.url" -wget -O - "http://www.reddit.com/r/wallpaper/top/.json?t=day" 2> /dev/null | jq -r ".data.children[0].data.url" diff --git a/.local/share/scripts/set-reddit-bg.sh b/.local/share/scripts/set-reddit-bg.sh index 96499c9..76b20b6 100755 --- a/.local/share/scripts/set-reddit-bg.sh +++ b/.local/share/scripts/set-reddit-bg.sh @@ -2,7 +2,7 @@ SCRIPT=$(readlink -f "$0") SCRIPTPATH=$(dirname "$SCRIPT") -URL=$($SCRIPTPATH/reddit-wp.sh) +URL=$($SCRIPTPATH/reddit-wp.sh $1) NAME=$(basename "$URL") FILENAME=~/pictures/wallpapers/"$NAME" wget "$URL" -nc -O "$FILENAME"