diff options
author | aszlig <aszlig@redmoonstudios.org> | 2017-04-23 22:50:46 +0200 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2017-04-23 23:08:13 +0200 |
commit | 04b7c6074816ed6c3ef63c48668dc23f1e75037b (patch) | |
tree | e1095cfbdd8b916eac22f4243901b987b1783d6e /pkgs/profpatsch/show-qr-code | |
parent | d9ff4eb2a99c9b1c0551752cf8bf98f413f5ab8e (diff) |
pkgs/show-qr-code: Move into pkgs/profpatsch
Tested evaluation using: nix-instantiate pkgs -A vuizvui.profpatsch.show-qr-code Signed-off-by: aszlig <aszlig@redmoonstudios.org> Cc: @Profpatsch
Diffstat (limited to 'pkgs/profpatsch/show-qr-code')
-rw-r--r-- | pkgs/profpatsch/show-qr-code/default.nix | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/pkgs/profpatsch/show-qr-code/default.nix b/pkgs/profpatsch/show-qr-code/default.nix new file mode 100644 index 00000000..17d9847a --- /dev/null +++ b/pkgs/profpatsch/show-qr-code/default.nix @@ -0,0 +1,28 @@ +{ stdenv, writeScriptBin, gtkdialog, qrencode }: + +let script = writeScriptBin "show-qr-code" '' + #!/bin/sh + TMP=$(mktemp) + ${qrencode}/bin/qrencode -s 8 -o "$TMP" -t PNG "$1" + + export DIALOG=' + <vbox> + <pixmap> + <input file>'$TMP'</input> + </pixmap> + </vbox> + ' + + ${gtkdialog}/bin/gtkdialog --program=DIALOG > /dev/null & + + sleep 0.2 + + rm "$TMP" + + ''; + +in script // { + meta = { + description = "Show the given string as qr code in a gtk window"; + }; +} |