Last active
June 5, 2025 01:41
-
-
Save smmr0/21244efee1c02d57bbd88472c36fdd85 to your computer and use it in GitHub Desktop.
OpenMoji: U+2600
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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