about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2022-09-16 18:55:36 +0200
committerProfpatsch <mail@profpatsch.de>2022-09-26 17:06:26 +0200
commite918ffef4e77b1a884806c6bd0bf190531c0f00e (patch)
tree664199843e3a65a9a6c214083683977e73297f91 /pkgs
parent70062e1eebaea2dcb5c2319f92aa486b00c02ecb (diff)
pkgs/profpatsch/show-qr-code: fix encoding with newlines
The Qr-code was done with a strange format that only allowed ASCII.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/profpatsch/show-qr-code/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/profpatsch/show-qr-code/default.nix b/pkgs/profpatsch/show-qr-code/default.nix
index 229d5ada..bf4b19f2 100644
--- a/pkgs/profpatsch/show-qr-code/default.nix
+++ b/pkgs/profpatsch/show-qr-code/default.nix
@@ -4,7 +4,14 @@ let script = writeScriptBin "show-qr-code" ''
   #!/bin/sh
   TMP=$(mktemp)
   trap 'rm "$TMP"' EXIT
-  ${qrencode}/bin/qrencode -s 8 -o "$TMP" -t PNG
+
+  if [ "$1" = "" ]; then
+    # read from stdin
+    ${qrencode}/bin/qrencode -s 8 --8bit -o "$TMP" -t PNG
+  else
+    # read from first arg
+    ${qrencode}/bin/qrencode -s 8 -o "$TMP" -t PNG "$1"
+  fi
 
   export DIALOG='
   <vbox>