This content originally appeared on DEV Community and was authored by DEV Community
Hello, there! I want to share with you how you can extend the functionality of your Mac OS X. To do this, you will need the Homebrew package manager to install a couple of small utilities.
With it you can set “zbar” to decode a QR code and “pngpaste” to get a screenshot from the clipboard to paste into a file.
Run this in the Terminal to install the utilities from Homebrew:
brew install zbar pngpaste
And for convenience you can encapsulate it in a separate script:
#! /bin/bash
FILENAME="$TMPDIR$RANDOM.png" # Generates a file name
pngpaste "$FILENAME" # Paste screenshot into file
zbarimg -q --raw "$FILENAME" # Will try to decode QR-code
rm -rf "$FILENAME" # Removing file for security
Remember to make the script executable using command: chmod + x
Highlight the QR code on screen using “Shift + Control + Command + 4” and just run the script!
I also shared the script on my Dropbox
Note: for correct results, scan non-stylized QR codes
This content originally appeared on DEV Community and was authored by DEV Community
DEV Community | Sciencx (2022-03-10T21:53:18+00:00) QR code reader for OS X. Retrieved from https://www.scien.cx/2022/03/10/qr-code-reader-for-os-x/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.