Bitcoin Forum
May 06, 2024, 10:24:16 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Ubuntu - QR Code Handy Utils  (Read 2538 times)
BkkCoins (OP)
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1009


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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!