posts/20230105_creating_inspirational_wallpapers_from_the_comfort_of_your_terminal #22
Replies: 2 comments
-
Building on what already exists in the article:
Feel free to use the following syntax after properly changing convert $img -colorspace Gray -font RobotoMono-Nerd-Font-Bd -pointsize 75 -gravity West -interline-spacing 35 -fill white -annotate +100+50 $quote $out && open $out |
Beta Was this translation helpful? Give feedback.
-
Another update here: Creating blank wallpaper backgroundsIf you want to keep it minimal, or simply reduce the visual load on your wallpapers you can do so by using a simple unique colors:
You can spice that up a little bit using Mass producing#!/bin/zsh
#
create_wallpaper(){
# 4 arguments
# quote, author, source_file, output
# Quote
quote=$1
author=$2
inputfile=$3
outputfile=$4
convert "$inputfile" \
-font "Roboto-Bold" \
-pointsize 100 \
-fill white \
-gravity SouthEast \
-annotate +100+300 "$quote" \
-font "RobotoMono-Nerd-Font-Bd" \
-pointsize 50 \
-fill "#CCCCCC" \
-annotate +100+200 "$author" \
"$outputfile"
}
if [[ $# -lt 3 && !(-f $1) && !(-f $2 || -d $2) ]]; then
echo "Improper usage:"
echo "\t$0 <quote_file> <image_file or dir> <output>"
return 1
fi
if [[ ! -d $3 ]]; then
echo "The output needs to be a directory"
return -1
fi
# Quotefile "syntax":
# "quote"author
cat $1 | sort -u | while read quoteline
do
quote="$(echo $quoteline | awk -F'"' '{print $2}')"
author="$(echo $quoteline | awk -F'"' '{print $3}')"
filehash="$(echo "$quoteline" | cksum - | awk '{print $1}')"
author_pref="$(echo $author | awk '{print toupper($(NF))}')"
outputfile="$3/${author_pref}_${filehash}_${$(basename $2)%.*}.png"
if [[ -n $quote ]]; then
echo "Now creating wallpaper(s) for $quote by $author"
if [[ -d $2 ]]; then
find $2 -type f | while read -r inputfile; do
outputfile="$3/${author_pref}_${filehash}_${$(basename $inputfile)%.*}.png"
create_wallpaper $quote $author $inputfile $outputfile \;
done
else
create_wallpaper $quote $author $2 $outputfile
fi
fi
done That script is not exactly fool-proof, but was helpful to me today. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
posts/20230105_creating_inspirational_wallpapers_from_the_comfort_of_your_terminal
Because, who does not want that!
https://blog.chatziiola.live/posts/20230105_creating_inspirational_wallpapers_from_the_comfort_of_your_terminal.html
Beta Was this translation helpful? Give feedback.
All reactions