summaryrefslogtreecommitdiffstatshomepage
path: root/dot_local/bin/executable_wqr
diff options
context:
space:
mode:
Diffstat (limited to 'dot_local/bin/executable_wqr')
-rwxr-xr-xdot_local/bin/executable_wqr8
1 files changed, 7 insertions, 1 deletions
diff --git a/dot_local/bin/executable_wqr b/dot_local/bin/executable_wqr
index 5f9d36d..b4cc123 100755
--- a/dot_local/bin/executable_wqr
+++ b/dot_local/bin/executable_wqr
@@ -8,4 +8,10 @@ else
text="$1"
fi
-printf '%s' "$text" | qrencode -t PNG -o - | imv -
+if [ "$(cat "$HOME/.config/dotfiles/role" 2>/dev/null)" = canonical ]; then
+ image=$(mktemp "${XDG_RUNTIME_DIR:?}/dotfiles-qr-XXXXXX.png")
+ printf '%s' "$text" | qrencode -t PNG -o "$image"
+ /usr/bin/xdg-open "$image"
+else
+ printf '%s' "$text" | qrencode -t PNG -o - | imv -
+fi