summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--misc/userscripts/README.md2
-rwxr-xr-xmisc/userscripts/qr8
2 files changed, 10 insertions, 0 deletions
diff --git a/misc/userscripts/README.md b/misc/userscripts/README.md
index fb38839d5..54b0e8e1a 100644
--- a/misc/userscripts/README.md
+++ b/misc/userscripts/README.md
@@ -32,6 +32,8 @@ The following userscripts are included in the current directory.
- [tor_identity](./tor_identity): Change your tor identity.
- [view_in_mpv](./view_in_mpv): Views the current web page in mpv using
sensible mpv-flags.
+- [qr](./qr): Show a QR code for the current webpage via
+ [qrencode](https://fukuchi.org/works/qrencode/).
[castnow]: https://github.com/xat/castnow
[youtube-dl]: https://rg3.github.io/youtube-dl/
diff --git a/misc/userscripts/qr b/misc/userscripts/qr
new file mode 100755
index 000000000..6b935beda
--- /dev/null
+++ b/misc/userscripts/qr
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+pngfile=$(mktemp --suffix=.png)
+trap 'rm -f "$pngfile"' EXIT
+
+qrencode -t PNG -o "$pngfile" -s 10 "$QUTE_URL"
+echo ":open -t file:///$pngfile" >> "$QUTE_FIFO"
+sleep 1 # give qutebrowser time to open the file before it gets removed