Bookmarks from the command line

Posted on Dec 14, 2023

I have written before about how I use gnu Bash scripts to perform everything under X Window System sessions on my Slackware Linux installation; in particular I have written about using a hierarchy of shell scripts to perform operations. See A bit of mbfl development in Marco’s 2020 Weblog.

I’ve been using and developing the menu script idea with some satisfaction; it is spilling everywhere; for example, my ~/.xinitrc looks like this:

#!/bin/bash
exec ~/bin/menu x-window initrc --verbose --show-program

I have a x-window script in which I put everything I need for X sessions, reusing functions, variables and whatever I need; it’s good. All the scripts use the mbfl.

To manage my web bookmarks I do not use any online service; not even the one implemented by Mozilla Firefox; I maintain a gnu Texinfo document containing links, which I edit with gnu Emacs having great pleasure in doing it; it is under the git revision control system; I generate html output from the document and that hierarchy of pages is my bookmarks database. Over the years I have collected quite a number of bookmarks; I am not going to move this database anywhere else. Just no. It does not matter which service will become available in the future.

Under Firefox I use the ‘Search for text when you start typing’ feature; so, while browsing one of the bookmarks pages, I just type the first letters of a bookmark to highlight it, then I press Enter to go to the page. It feels good for a keyboard–dependent user like me.

But I want more.

There are a few pages I visit every day, mostly news sites; other pages I visit for special purposes, like Wiktionary and Wikizionario. For these I’m experimenting opening a new tab in the browser from the command line; the very basic way of doing it is:

firefox --new-tab 'https://www.reuters.com/'

I’m integrating this feature in my command line environment using not only the menu script, but also some shell functions with short names; so I issue commands like:

$ n reuters
$ n reuters markets

in which ‘reuters’ and ‘markets’ are known arguments for which command line autocompletion is available; I’m experimenting with a command line interface to go to a specific page on Wiktionary like:

$ n wiktionary usher

which will open a new tab for the meaning of the word “usher”. And so on.

Technologically it works; I have to see if my brain will integrate these commands in the, already big, keyboard–only map of automated procedure–launching actions.

One could say: why don’t you do this autocompletion thing for all your bookmarks? You just need an actual database! These are my reasons:

  1. I already have search–by–typing in my bookmarks pages.
  2. The infrastructure would be much more complicated.
  3. Most web pages need a “long” description to be recognised; this means when requesting the list of available completions from the command line: the screen would fill with a wall of text that is difficult to parse.

So: no.