From f07306498f7f4e7e9f4cad97f8bc90c97af6bc13 Mon Sep 17 00:00:00 2001 From: Quartz Syncer Date: Mon, 19 Jan 2026 18:40:22 -0700 Subject: [PATCH] Published multiple files --- .../13 TECH SETUP/13.11 APPS/qutebrowser.md | 5 ++ .../13 TECH SETUP/13.11 APPS/urlref.md | 79 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 content/10-19 LIFE/13 TECH SETUP/13.11 APPS/qutebrowser.md create mode 100644 content/10-19 LIFE/13 TECH SETUP/13.11 APPS/urlref.md diff --git a/content/10-19 LIFE/13 TECH SETUP/13.11 APPS/qutebrowser.md b/content/10-19 LIFE/13 TECH SETUP/13.11 APPS/qutebrowser.md new file mode 100644 index 0000000..ee42777 --- /dev/null +++ b/content/10-19 LIFE/13 TECH SETUP/13.11 APPS/qutebrowser.md @@ -0,0 +1,5 @@ +--- +{"publish":true,"title":"qutebrowser","created":"2026-01-19T18:10:16.270-07:00","modified":"2026-01-19T18:15:29.016-07:00","tags":["web"],"cssclasses":""} +--- + +One of the gifts I have received from a career in tech is some gnarly RSI. It sucks. My life is considerably better the more I can use a keyboard and the less I can use a mouse. For the longest time the biggest obstacle for me was the web browser, all of which seemed to lean on the mouse over anything else. I recently discovered [qutebrowser](https://www.qutebrowser.org/) though and it is an absolute game changer. It has some limitations, and occasionally I have to jump to Vivaldi or similar to get something working. For the most part though it is now my daily driver and I love it. \ No newline at end of file diff --git a/content/10-19 LIFE/13 TECH SETUP/13.11 APPS/urlref.md b/content/10-19 LIFE/13 TECH SETUP/13.11 APPS/urlref.md new file mode 100644 index 0000000..db04119 --- /dev/null +++ b/content/10-19 LIFE/13 TECH SETUP/13.11 APPS/urlref.md @@ -0,0 +1,79 @@ +--- +{"publish":true,"title":"urlref","created":"2026-01-19T18:15:38.889-07:00","modified":"2026-01-19T18:40:10.504-07:00","tags":["web","note_taking"],"cssclasses":""} +--- + +As an avid user of pen and paper for note taking I have had endless trouble figuring out how to store url's without having to write them out in full. I seem to have found a solution to this issue with [urlref](https://benjaminhollon.com/musings/urlref/) from the fantastic [Benjamin Hollon](https://polymaths.social/@amin). I did have a little bit of fun setting up for myself though so I am documenting here in case it is helpful to anyone, including future me. +## Installation +### Install Nim +**Arch Linux:** +```bash +sudo pacman -S nim nimble +``` +**Other distributions:** +See https://nim-lang.org/install.html +### Build +```bash +cd urlref +nimble build +``` +### Install system-wide (optional) +```bash +nimble install +``` +This installs the binary to `~/.nimble/bin/`. Ensure it's in your PATH: +```bash +export PATH="$HOME/.nimble/bin:$PATH" +``` +## Usage +### Create a short reference +```bash +urlref create "https://example.com/some/long/url" +# Output: ABC +``` +### Start the redirect server +```bash +urlref +``` +The server runs on port 9873. Visiting `http://localhost:9873/ABC` redirects to the original URL. +## Examples +### systemd service +```bash +[Unit] +Description=URL Reference Redirect Server +After=network.target + +[Service] +ExecStart=%h/.nimble/bin/urlref +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=default.target +``` +### qutebrowser Integration +This [[10-19 LIFE/13 TECH SETUP/13.11 APPS/qutebrowser]] integration works for me, you are on your own for other browsers! +#### Userscript +Should live at `~/.local/share/qutebrowser/userscripts` +```bash +#!/bin/bash +# Qutebrowser userscript to shorten the current URL using urlref + +shortcode=$(~/.nimble/bin/urlref create "$QUTE_URL") + +if [ -n "$shortcode" ]; then + echo "message-info 'Shortcode: $shortcode'" >> "$QUTE_FIFO" + echo "yank inline $shortcode" >> "$QUTE_FIFO" +else + echo "message-error 'Failed to create shortcode'" >> "$QUTE_FIFO" +fi +``` + +Bind it to a key +```python +config.bind('ar', 'spawn --userscript urlref-shorten') +``` + +Add a custom search engine +```python +c.url.searchengines['r'] = 'http://localhost:9873/{}' +```