Bitcoin Forum
December 04, 2016, 08:26:05 PM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Ubuntu - QR Code Handy Utils  (Read 2303 times)
BkkCoins
Hero Member
*****
Offline Offline

Activity: 784


firstbits:1MinerQ


View Profile WWW
July 02, 2011, 09:08:57 AM
 #1

Here's some handy info if you want to play with scanning QR codes in Ubuntu.
I know there's probably a gui app but this has it's uses too. It's quick once setup and can be automated easily.

Get some needed packages,

sudo apt-get install zbar-tools
sudo apt-get install xclip

Command to scan a QR and put on clipboard, ready to paste,

zbarimg -q --raw "$1" |xclip -selection c

Command to scan using webcam and put on clipboard - this one puts up a preview and when the green square is good press "space", and close window (X). (Better if it auto-closed...)

zbarcam --raw |xclip -selection c

I put these together into a tiny script that does both depending on file parm given,
Code:
#!/bin/bash

if [ -n "$1" ]; then
  zbarimg -q --raw "$1" |xclip -selection c
else
  zbarcam --raw |xclip -selection c
fi

Now you can attach this script to a menu item, or key or desktop shortcut easily.

For capturing a file you can attach it to a Nautilus Action file selected file as parm (%f) and it will allow you to right click any image to convert. I'd suggest adding a couple mime-type selectors  so it only shows for png and jpeg files, not all of them.


Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!