BlackWindBooks.com | risingthumb.xyz | achtung | github | itch | site map

risingthumb.xyz Worse than the alternative

Browser-agnostic bookmarks by Shell Scripting

The Script

Minimal form

#!/bin/sh
link=$(cat "$HOME/.bookmarks" | xmenu)
$BROWSER $link

Expanded form(what I use on my system)

#!/bin/sh
link=$(cat "$HOME/.bookmarks" | xmenu)
if [[ "$link" == "firefox" ]]; then
    firefox
elif [[ "$link" == "default" ]]; then
    $BROWSER
elif [[ "$link" == "" ]]; then
    exit;
else
    $BROWSER $link
fi

The only difference between the minimal and expanded form is that the expanded form lets me handle default cases or opening a different browser. Not particularly useful for most people I don't think...

.bookmarks file

Default	https://risingthumb.xyz
Jellyfin GUI	http://localhost:8096/web/#/home
Syncthing GUI	http://127.0.0.1:8384/
Software Sites
	N-Gate	http://n-gate.com/
	2f30	https://2f30.org/home.html
	Suckless	https://suckless.org

Explanation

I have an environment variable called $BROWSER which points to whichever browser I use. Whenever I switch browser to a new browser, i.e. Brave to Firefox, I just change this to be firefox then when I pass a url to the firefox program it opens it up in that browser.

The fetching of links is the most complex part. I use a program called xmenu which spawns a nice Windows XP-style window with categories(as an example in that .bookmarks file, the Software Sites category). Additionally it allows me to define if I want to open a link in another browser for whatever reason. The first 2 conditions of link == default and link == firefox can probably be skipped if you don't care for a default case or for using multiple browsers on the same system(which can be useful when you hit browser limitations).

This approach can be easily customised so you can use a different tool for selecting things. Examples of other tools include fzf(for selecting from a CLI), dmenu, and gnome-pie and probably more menu tools. You will have to prepare your bookmarks file so it is the correct format for your menu software, and you may have to add in additional parts to the script if your menu software doesn't give you just the URL part.

Articles from blogs I follow around the net

Movies: Johnny Belinda (1948)

A kind doctor volunteers to tutor a deaf-mute woman, but scandal starts to swirl when his pupil is raped and falls pregnant. Directed by the great Jean Negulesco and putting together two great actors: Jane Wyman and Lew Ayres, this is a beautiful and emoti…

via andrei.xyz November 24, 2025

THE REPUBLIC #50

TRUANCY It's treason then. —Shreev Palpatine Another day, another fifty cents. Another twenty years later. The fucking place was called Sh'ack'real, and Slake was beyond tired of coming back there. Nearly two hundred years subjective since he'…

via I'm not really Stanley Lieber. November 22, 2025

2025 in review

This is the last article of 2025, see you next year. Happy holidays! Friend, it’s real, even if it ends. I’ve had people who left me or who I left, some hate me now, some I’ll still say hello to, once in a blue moon. These people are no longer actively in …

via sizeof(cat) November 21, 2025

Generated by openring