4

QR code reader for OS X

 2 years ago
source link: https://dev.to/asahiocean/qr-code-reader-for-os-x-20ed
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

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

Enter fullscreen mode

Exit fullscreen mode

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

Enter fullscreen mode

Exit fullscreen mode

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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK