Skip to content

Instantly share code, notes, and snippets.

@smmr0
Last active June 5, 2025 01:41
Show Gist options
  • Select an option

  • Save smmr0/21244efee1c02d57bbd88472c36fdd85 to your computer and use it in GitHub Desktop.

Select an option

Save smmr0/21244efee1c02d57bbd88472c36fdd85 to your computer and use it in GitHub Desktop.
OpenMoji: U+2600
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env sh
set -euf
script_dir="$(dirname "$(readlink -e -- "$0")")" # https://stackoverflow.com/a/29835459/16330198
default_input_f="$script_dir/2600.svg"
is_integer() {
string="$1"
# https://stackoverflow.com/a/3951175
case "$string" in
''|*[!0-9]*)
return 1
;;
*)
return 0
;;
esac
}
if is_integer "$1"; then
input_f="$default_input_f"
else
input_f="$1"; shift
fi
width="$1"; shift
if [ -n "${1-}" ]; then
output_f="$1"; shift
else
output_f="$(basename "$input_f" '.svg')-$width.png"
fi
rsvg-convert --width="$width" "$input_f" --output="$output_f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment