QR-codes

After post about QR-codes, version without using Google Chart API.

qrcode - to make QR-code and display it - desktop version:

#!/bin/bash
qrencode -o /tmp/qr.png
feh /tmp/qr.png
rm /tmp/qr.png

qrcode - to make QR-code and display it - N900 version:

#!/bin/bash
qrencode -o /tmp/qr.png
phone-control --browse file:///tmp/qr.png

Changes between versions is minimal - different image viewer.

On desktop you should install media-gfx/qrencode and feh (or change script to use different viewer), on N900 - qrencode and phone-control (both from extras-devel).

Usage:

$ qrcode < file
$ qrcode
  text
  text2
  Ctrl-D

On N900 I added DCEW widget to invoke qrcode.

Command:

sh -c "osso-xterm -e /home/user/.bin/qrcode &" | echo ""

Reading of QR-codes is remained as it was.

UPD: qrcode-clip - reads from clipboard, both on N900 and on desktop:

#!/bin/bash
clip=`xclip -o -selection clipboard`
if [ "$clip" != "" ]; then
    echo "$clip" | qrencode -o /tmp/qr.png
    phone-control --browse file:///tmp/qr.png
fi
blog comments powered by Disqus