[bglug] Face e Qrcode

k|b|s kbs@bglug.it
Gio 8 Apr 2010 17:17:48 CEST


In un qrcode ci stanno tante informazioni (anche in pgp... ;^), ma la
più comoda è inserirvi un url o un mailaddress.
Pertanto non sarebbe male utilizzare un campo X-Qrcode o similare per
veicolare via mail i vostri indirizzi; ma fintanto che non c'è
utilizzeremo il campo Face, lasciando libero il campo x-face per il
nostro logo.

Con questo script creeremo l'immagine e il relativo testo da
aggiungere agli header (necessitate di qrencode e imagemagick):


----8<---- CUT HERE ----8<----
#!/bin/bash
# Time-stamp: <make_qrcode, 8/4/2010 16:56:48 joe Exp>

# Inserisci il testo
code="http://www.bglug.it"

#####################
tmpback=/tmp/back.jpg
tmpface=/tmp/face.jpg

convert -size 48x48 xc:white $tmpback
qrencode -o $tmpface -s 1 "$code"
composite -gravity center $tmpface $tmpback "$code"-qrcode.jpg
mimencode "$code"-qrcode.jpg | sed 's/^$*/ /' > "$code"-qrcode.txt

rm $tmpback $tmpface
----8<---- CUT HERE ----8<----

IIRC, oltre a gnus, sia claws che kmail vi fanno vedere le faces; chi
usa mutt può utilizzare questo wrapper:

----8<---- CUT HERE ----8<----
#! /bin/sh
# Time-stamp: <view_Face, 8/4/2010 15:43:3 joe Exp>
#
# Save a macro in mutt: 
# macro	pager	\eF	"|view_Face\n"

tmpface="/tmp/Face.tmp"
viewer="xv -nodecor -quit -"

cat "$@" \
| sed -n -e '/^Face:/,/^[^ \t]/ p' \
| sed -n -e 's/^Face://' -e '/^[ \t]/ p' \
| sed -e 's/^[ \t]\+//' > $tmpface
recode -f /base64 < $tmpface | $viewer
----8<---- CUT HERE ----8<----

Have phun ;^)


-- 
             ☿ ⚗ ☉
$(echo 1801614090P|dc)@bglug.it



Maggiori informazioni sulla lista bglug