bm - A Simple Bookmarking Script

I’m sick and tired of bookmarks in browsers.
Synchronizing them is a pain, especially if you use several different browsers, or even if you use the same browser on a few devices but are privacy-conscious and don’t want to use something like Firefox Sync or, God forbid, a Goolag account.
To add insult to injury, Tor Browser can sometimes delete bookmarks after an update - that was the final straw which motivated me to write this script. It’s not the most elegant but gets the job done and can be easily improved thanks to its simplicity. You can find it here.

Installing the script

  1. Make sure you have these programs installed: fzf, xclip, xdg-utils, papirus-icon-theme.

  2. Open the bm file in a text editor and replace /home/user/Documents/bookmarks/ with the full path to your bookmarks folder.

  3. If you don’t have the Papirus icon theme installed, you can replace /usr/share/icons/Papirus/64x64/apps/xclipboard.svg with your desired icon for notifications.

  4. Move the edited bm file into a PATH folder.
    To find such folders, run echo $PATH in a terminal. You can also create a folder for scripts and add it to PATH.

Adding bookmarks

This is an example directory tree of a bookmarks folder:

├── art
├── cooking
├── electronics
├── fitness
├── linux
├── misc
├── self-hosted
└── text_editing
    ├── groff
    ├── latex
    └── vim

To add a bookmark, simply create a text file in the category of your choice and paste the website’s URL address into the first line of the file. The name of the file will be the bookmark’s title.

Opening bookmarks

Open the terminal and execute bm. Now you can search for a category or specific bookmark. Press enter to open the link.

Thanks to fzf, you don’t have to type in the exact words.
For example, if you want to find bookmarks in the “linux” category containing the word “server”, you can type in “linserv” and you’ll likely get decent results.

The script also detects .onion links. When you want to open such a link, it gets copied to clipboard and a notfication is shown.


This post illustrates that you don’t have to be a programmer to write a basic shell script - you just need to be pissed off enough.
I use Syncthing to keep my bookmarks folder synced on all devices.
bm is still a work-in-progress. I might add detection of i2p links in the future, and maybe a second script for creating bookmarks so you don’t have to create text files with links manually. If you have ideas on how to improve it, email me or open an issue/pull request on GitHub.
If you’re looking for something more advanced, check out Linkding. I was considering it myself but couldn’t justify hosting a web service to sync bookmarks between just two compters.