Created
December 8, 2025 14:44
-
-
Save jpmens/775bd8078e477e7b7129e1dda36acc7d to your computer and use it in GitHub Desktop.
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
| #!/bin/sh | |
| [ $# -ne 1 ] && { echo "Usage: $0 URL" >&2; exit 2; } | |
| # I need '*.svg' so that open(1) does its thing. The following | |
| # inserts the variable part *after* the file extension on macos: | |
| # svg=$(mktemp -t gist-XXXXXXXXX.svg) | |
| # | |
| f=$(python3 -c 'import tempfile; \ | |
| print("{0}.svg".format(tempfile.NamedTemporaryFile(delete=False).name))') | |
| echo "$f" >&2 | |
| qrencode -s 10 -l H -t SVG -o "${f}" "$1" | |
| open -a safari "${f}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment