<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Plain DrOps (Posts about userscript)</title><link>https://plaindrops.de/</link><description></description><atom:link href="https://plaindrops.de/categories/userscript.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:andy@plaindrops.de"&gt;Andy Drop&lt;/a&gt; </copyright><lastBuildDate>Wed, 12 Aug 2026 11:08:20 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Qutebrowser and URLs as QR-codes</title><link>https://plaindrops.de/blog/2019/qutebrowser-and-urls-as-qr-codes/</link><dc:creator>Andy Drop</dc:creator><description>&lt;p&gt;
When I have been to the 35c3 in Leipzig I saw a pretty firefox addon that became very handy when we wanted to share the URL to a freshly created pad. It was &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/fxqrl/?src"&gt;FxQRL&lt;/a&gt; a Firefox add-on that turns your URLs into QR code images without the need of a network connection.
Everyone of us could then scan this code with our mobile phones, and we were done.
&lt;/p&gt;
&lt;!-- TEASER_END --&gt;

&lt;p&gt;
I don't use Firefox but it immediatly appeared to me that this function could be copied with qutebrowser without any problems
&lt;/p&gt;

&lt;p&gt;
&lt;a href="https://qutebrowser.org/"&gt;Qutebrowser&lt;/a&gt; is a browser based (by default) on QTWebEngine, and is very easily extendable via userscripts. To get me the same functionality as the FxQRL addon of Firefox has, I just need to call such a userscript, and to make it even easier bind that call to a key I dont need otherwise.
I did that with this command:
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;:bind&lt;span class="w"&gt; &lt;/span&gt;q&lt;span class="w"&gt; &lt;/span&gt;spawn&lt;span class="w"&gt; &lt;/span&gt;--userscript&lt;span class="w"&gt; &lt;/span&gt;link2qr
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;
That will call a userscript named 'link2qr' everytime I press 'q.' 
The only thing that was left to do was creating that userscript. Qutebrowser is very relaxed, in what it calls a userscript. It just has to be executable and live in the directory reserved for those scripts. So my script just looks like this:
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="ch"&gt;#!/bin/bash&lt;/span&gt;

qrencode&lt;span class="w"&gt; &lt;/span&gt;-o&lt;span class="w"&gt; &lt;/span&gt;-&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$QUTE_URL&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;feh&lt;span class="w"&gt; &lt;/span&gt;-
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;
In this script two tools are used:
&lt;/p&gt;
&lt;ol class="org-ol"&gt;
&lt;li&gt;qrencode, which encodes a given string into a QR-code, and pipes it to&lt;/li&gt;
&lt;li&gt;feh, which then shows it on the screen&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
For an example page, it looks like this:
&lt;/p&gt;

&lt;p&gt;
&lt;img src="https://plaindrops.de/images/link2qr.png" alt="A screenshot with qutebrowser showing a random page in the left 80% of the screen and a black window with an qr-code in the right 20% of the screen"&gt;
&lt;/p&gt;

&lt;p&gt;
So now I have the same functionality in my browser, without relying on code that someone else has written.
&lt;/p&gt;</description><category>qr-code</category><category>qutebrowser</category><category>userscript</category><guid>https://plaindrops.de/blog/2019/qutebrowser-and-urls-as-qr-codes/</guid><pubDate>Tue, 01 Jan 2019 18:56:29 GMT</pubDate></item></channel></rss>