Skip to content

Instantly share code, notes, and snippets.

@michaelskyba
Last active December 3, 2021 18:50
Show Gist options
  • Save michaelskyba/700366b6649f4dc6fa6cba6c264d3da2 to your computer and use it in GitHub Desktop.
Save michaelskyba/700366b6649f4dc6fa6cba6c264d3da2 to your computer and use it in GitHub Desktop.
#!/bin/sh
doc='
msk_display: display a short text in an image using imagemagick
useful for e.g. showing Japanese characters in a proper font
usage: msk_display "<text>"
sxiv is not called with &, so you might want to run msk_display ... &
'
[ -z "$1" ] \
&& echo "$doc" \
&& exit 1
tmpfile=$(mktemp).png
convert -background LemonChiffon -fill black -font /usr/share/fonts/OTF/NotoSansJP-Regular.otf -pointsize 72 label:"$1" "$tmpfile"
sxiv "$tmpfile"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment