Skip to content

Instantly share code, notes, and snippets.

@tdewin
Created February 13, 2025 08:50
Show Gist options
  • Save tdewin/80bf498356b830d00bbbd5626dd206d6 to your computer and use it in GitHub Desktop.
Save tdewin/80bf498356b830d00bbbd5626dd206d6 to your computer and use it in GitHub Desktop.
Create a qr code from Mac clipboard (pbpaste). Uses Inkscape barcode tool.
#!/bin/zsh
tmp="$HOME/tmp"
mkdir -p $tmp
inks="/Applications/Inkscape.app/Contents/Resources/"
cd $inks
qrpath="share/inkscape/extensions/render_barcode_qrcode.py"
python3="bin/python3"
#allargs="${@}"
allargs="$(pbpaste)"
echo "$allargs"
echo "<svg></svg>" | $python3 $qrpath --text "$allargs" | rsvg-convert -o "$tmp/tmpqr.png" -
open "$tmp/tmpqr.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment