QR code reader for OS X

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” …


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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » QR code reader for OS X." DEV Community | Sciencx - Thursday March 10, 2022, https://www.scien.cx/2022/03/10/qr-code-reader-for-os-x/
HARVARD
DEV Community | Sciencx Thursday March 10, 2022 » QR code reader for OS X., viewed ,<https://www.scien.cx/2022/03/10/qr-code-reader-for-os-x/>
VANCOUVER
DEV Community | Sciencx - » QR code reader for OS X. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/03/10/qr-code-reader-for-os-x/
CHICAGO
" » QR code reader for OS X." DEV Community | Sciencx - Accessed . https://www.scien.cx/2022/03/10/qr-code-reader-for-os-x/
IEEE
" » QR code reader for OS X." DEV Community | Sciencx [Online]. Available: https://www.scien.cx/2022/03/10/qr-code-reader-for-os-x/. [Accessed: ]
rf:citation
» QR code reader for OS X | DEV Community | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.