From 6c42f977814a3bfe937235b269bb80a5ba81a7a5 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 2 Dec 2020 10:41:36 +0100 Subject: Add QR userscript --- misc/userscripts/README.md | 2 ++ misc/userscripts/qr | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100755 misc/userscripts/qr 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 -- cgit v1.2.3-54-g00ecf