[PATCH 1/1] fix terminal qrcode not picking up

Matan Nassau matan.nassau at gmail.com
Tue Apr 18 20:03:51 CEST 2017


qr apps often need a good brightness boost to help them out. qrencode's
-tutf8 and -tascii don't produce a bright background, so if the terminal
has a dark background a qr reader might not be able to read the qr code.
any of the -tansi{,256} -tasciii output types perform better than the
utf8 alternative, since they produce a bright background.

i find -tansi looks best, although one may argue -tasciii works as well
and is a more conservative and platform-independent option than the
alternatives. i use -tansi here because <reasons>.

to test, i scanned generated qrcodes on my phone with a qr code scanner
app.
---
 src/password-store.sh  | 2 +-
 src/platform/darwin.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/password-store.sh b/src/password-store.sh
index d77ff12..6d03cef 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -190,7 +190,7 @@ qrcode() {
 			return
 		fi
 	fi
-	echo -n "$1" | qrencode -t utf8
+	echo -n "$1" | qrencode -t ansi
 }
 
 tmpdir() {
diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh
index 86eb325..44137fb 100644
--- a/src/platform/darwin.sh
+++ b/src/platform/darwin.sh
@@ -39,7 +39,7 @@ qrcode() {
 	elif type display >/dev/null 2>&1; then
 		echo -n "$1" | qrencode --size 10 -o - | display -title "pass: $2" -geometry +200+200 -
 	else
-		echo -n "$1" | qrencode -t utf8
+		echo -n "$1" | qrencode -t ansi
 	fi
 }
 
-- 
2.12.2



More information about the Password-Store mailing list