Skip to content

Instantly share code, notes, and snippets.

@scmx
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scmx/63ec99c3a23196e46e12 to your computer and use it in GitHub Desktop.
Save scmx/63ec99c3a23196e46e12 to your computer and use it in GitHub Desktop.
Turn clipboard content into a QR code #osx #pbpaste #qrencode #pbqropen #clipboard #crcode #shortcut #automator #shell

Add a new automator script, choose type: Service

Choose input: none

Tell it to run a shell script:

# Path to where you saved pbqropen
$HOME/.bin/pbqropen

Save your service

Open system settings > Keyboard > Shortcuts > Services

Choose something like Cmd+Shift+8

Done!

img

#!/usr/bin/env bash
# @author gist.github.com/scmx
filename=/tmp/pbqropen-$(date +%Y%m%d-%H%M).png
# Save QR image to /tmp
pbpaste | /usr/local/bin/qrencode -o $filename
# Open up the QR image with Preview.app
open $filename
# Optionally remove the file immediately
rm $filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment