Skip to main content

Bookmarks, Buku and Bukubrow Host

See update below!

Bookmarks and buku

When I reached over 1K web browser bookmarks, not counting external links in my old personal wiki and saved links littered all over my file system in various obscurely named text files I realized I had to find a better way to manage and organize my bookmarks. I did some research and found some alternatives and finally decided to settle on buku.

Buku is a quite powerful and easy to use command line program and I've grown to heavily depend upon it. After using it for a good while it's hard to imagine living without it. It, together with vimwiki, makes up my extended knowledge base. I haven't looked up the numbers but I believe it's one of my most frequently used commands.

Even though I enjoy living in the terminal I found it annoying when browsing the World Wide Web and every time I wanted to access a bookmark I had to go to a terminal. This gets old fast. I like the convenience of having your bookmarks right there at your disposal in the browser.

Luckily you can export your bookmarks from buku to a importable HTML file (buku -e bookmarks.html) but buku lacks functionality to integrate bookmarks automagically to your browser so I took up the habit of manually exporting all buku bookmarks, then deleting my Firefox bookmarks and finally re-importing the buku bookmarks every Sunday night.

Needless to say, this was a boring and tedious process so I started thinking of automating the process. I thought this would be simple since both buku and in my case Firefox both uses sqlite3.

My idea was to create a Python script and call it from a crontab entry or a systemd timer to once every, say, 24 hours open both the buku database and the Firefox default profile database. Then for every bookmark in the buku database, check; if URL not in Firefox database; add it with corresponding title, tags and comment. If URL in Firefox database; check that tags and other information agree with buku information, fix any discrepancies. Else: do nothing. Finally, close both databases.

It turned out that inserting a bookmark into Firefox using a SQL Query was a little over my head and I never got around to seriously attempting to do this even though I believe I could do it if I committed myself to it. 1

Bukubrow Host

Sam A. Horvath-Hunt beat me to it, or rather solved this in a different way.

Bukubrow is a WebExtension for Buku, a command-line bookmark manager. This is the corresponding host that facilitates interfacing with the Buku database via native messaging.

Bukubrow consists of two parts. A Firefox add-on and a local man-in the-middle application that lets buku talk to the browser. The local application is written in Rust and installation was easy, at one point it complained about some Windows OS detection thing, but I simply deleted that code block and it compiled just fine. Then I copied the binary target/release/bukubrow to /usr/local/bin/ and ran bukubrow --install-firefox. Beforehand I had installed the Firefox add-on Bukubrow. It works!

Bukubrow is pretty neat. It gives you an icon to the right of the address bar in the browser. By clicking the icon you can access your buku bookmarks. If I understand things correctly it also gives you suggestions based on the current website. I've only been using it for a couple of days but it works well.


Even though this setup is infinitely more of an improvement compared to my previous routine of importing bookmarks manually it's not quite what I want, I would prefer if I could override the Firefox database completely or replace it with the buku(brow) stuff. Or rather, the main point for me is to have my bookmarks searchable in the address bar, how this is accomplished doesn't really matter.

I also found it annoying to have to click on that icon to access bookmarks but there's a fix for this. You can create a keyboard shortcut by going to Add-ons -> Manage Extension Shortcuts. I wanted to override the default ctrl+b but but you get an error message saying "Can't override a Firefox shortcut". I did some googling but couldn't find a straightforward way to override default Firefox shortcuts so I settled for the second best combo ctrl+shift+b.

Another minor annoyance is that you have to navigate in bukubrow with the arrow keys and not j,k.

In conclusion, this setup is not ideal for me and I'm not sure that I'll stick with it in the long run. Maybe I'll give my ugly hack mentioned above a try. We'll see.

Update Mon 03 May 2021 04:52:07 PM CEST

As of version Bukubrow now supports address bar suggestions! If you type 'buku' followed by a search term in the address bar you get suggestions from your Buku database.

This is wonderful and certainly a killer feature for me. No need to map Bukubrow searches to the slightly awkward ctrl+shift+b or delete and re-import over 3000 bookmarks into Firefox every now and then.

Yay! This makes my life a whole lot easier.

Thank you samhh!