mirror of https://github.com/Chizi123/Reddit-wallpaper-fetcher.git

Joel Grunbaum
2020-12-07 cb29fdbc827237a91ebffae902ee7b01fa8b4f8f
Added resizing
2 files modified
10 ■■■■ changed files
README.org 2 ●●● patch | view | raw | blame | history
reddit-wallpaper-fetcher 8 ●●●● patch | view | raw | blame | history
README.org
@@ -13,4 +13,4 @@
* TODOs
- Interface with the window manager to set the wallpaper
- Setup image scaling/resizing
# - Setup image scaling/resizing
reddit-wallpaper-fetcher
@@ -61,9 +61,9 @@
echo https://reddit.com$(echo $LATEST | jq ".data.children[-1].data.permalink" | sed 's/"//g') >> $WALLDIR/data.txt
#Add image title
convert "$WALLDIR/temp.$ext" -crop "$SIZE+0+0" -resize "$SIZE!" "$WALLDIR/wallpaper.jpg"
rm "$WALLDIR/temp.$ext"
if [ $WRITE_TITLE == 1 ]; then
    convert "$WALLDIR/temp.$ext" -fill "$TITLE_COLOR" -gravity "$TITLE_POSITION" -pointsize "$TITLE_SIZE" -annotate 0 "$title" "$WALLDIR/wallpaper.jpg"
else
    convert "$WALLDIR/temp.$ext" "$WALLDIR/wallpaper.jpg"
    convert "$WALLDIR/wallpaper.jpg" -fill "$TITLE_COLOR" -gravity "$TITLE_POSITION" -pointsize "$TITLE_SIZE" -annotate 0 "$title" "$WALLDIR/wallpaper.jpg"
fi
rm $WALLDIR/temp.$ext