- Go 85.8%
- Nix 14.2%
| .gitignore | ||
| default.nix | ||
| flake.lock | ||
| flake.nix | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| loadVariables.go | ||
| main.go | ||
| package.nix | ||
| parse.go | ||
| README.md | ||
| types.go | ||
| utils.go | ||
📚 book
Simple bookmark manager written in go
https://github.com/user-attachments/assets/150bcd63-2e35-4703-8e04-ea6dda61cbe9
Index
Instalation
Arch Linux
You can install the program from the AUR:
paru -S book-git
Manual
You can also build the project yourself, you will need go installed:
[!IMPORTANT] Make sure you have go installed, your
$GOPATHis set and added to your$PATH
git clone https://github.com/m4rti21/book.git
cd book
go install
Dependencies
The only "dependency" is a menu program:
- Linux:
dmenu,rofi,tofi,wofi, etc... - MacOS:
dmenu-mac,choose-gui, etc... - Windows: literally no clue, this probram should be able to work on windows but i have not tested it, no idea if rofi-like programs exist for windows.
make sure to specify this in the menu option on the config.toml
(explained in the Configuration section)
[!NOTE] The default run command is
xdg-opento open the url on linux, if you are using MacOS you should change therunoption toopenin theconfig.toml(explained in the Configuration section)
Configuration
The default config directory is $XDG_CONFIG_HOME/book, if the variable
is not set then it will fallback to ~/.config/book.
Settings
The program will look for a file called config.toml in the config directory.
The allowed options are:
| name | type | default | flag | description |
|---|---|---|---|---|
| folderIcon | string | "" |
-f | icon used for folders |
| menu | string | "dmenu" |
-m | program for displaying the options (has to accept stdin for the entires) |
| run | string | "xdg-open" |
-r | program for opening the selected url |
| showUrl | boolean | true |
-u | weather to show the url if a name is provided |
| showAll | boolean | true |
-a | weather to show all urls at once |
Example:
# config.toml
menu = "tofi"
showUrl = false
Note
The next options only exist as flags, they will be ignored if present in the config file
| name | type | default | flag | description |
|---|---|---|---|---|
| config | string | "$XDG_CONFIG_HOME"/book/config.conf |
-c | location of the base config file |
| directory | string | "$XDG_CONFIG_HOME"/book |
-d | location of the directory where .conf will be searched for |
Bookmarks
Inside the config directory create file called <collection-name>.conf where your
bookmarks will be stored, for example personal.conf. You can have as many
collections as you want. The file is divided in two sections: [config] and [bookmarks].
Important
Indentation in this file SHOULD be 4 spaces, somehow it seems to work with other amounts of spaces but it is not guaranteed to work.
The [config] section can be used to override the global settings defined at the
config.toml file (for example, there might be a collection of bookmarks you might
want to show on a different menu or launch them with a different browser).
Note
The
showUrloption is not available in the[config]section of the.conffiles, it can only be set in theconfig.tomlfile or as a flag.
Example:
# personal.conf
[config]
menu = "tofi"
run = "xdg-open"
The [bookmarks] section is where all the bookmarks will be defined, the syntax
goes as follows:
After the [bookmarks] tag we will define all the base level bookmarks, meaning
this are the bookmarks you will first see when running the program.
Each bookmark line can have 1 or 2 arguments, if only 1 is provided that must be
the URL, if instead you have 2 the first one will be the Label/Name of the url
and the second one will then be the URL. Each argument must start and end with
double quotes " and cannot contain a double quote, they must be separated by
at least one space.
Example:
# personal.conf
[bookmarks]
"Example" "https://example.com" # This is a comment
"Another Example" "https://someotherurl.com/i/dont/know"
"https://unnamedurl.com" # This url doesnt have a name
You can also define sub-folders, to define one the line must start with the star
* symbol, anything following will be the folder name
Example:
# personal.conf
[config]
menu = "tofi"
run = "xdg-open"
[bookmarks]
"Example" "https://example.com" # This is a comment
"Another Example" "https://someotherurl.com/i/dont/know"
"https://unnamedurl.com" # This url doesnt have a name
* This is a folder
"Woah how cool" "https://how.cool"
"Woah how cool" "https://how.cool"
"Woah how cool" "https://how.cool"
* More??? # You can add as many sub-sub folders as you want
"You get the point" "https://i.am.runnign/out/of/url/ideas
#...
#...
#...
* This is another folder
"I am in your walls" "https://wake.up/wake/up/wake/up"
"I am in your walls" "https://wake.up/wake/up/wake/up"
"I am in your walls" "https://wake.up/wake/up/wake/up"
Usage
book [OPTIONS] [COLLECTION-NAME]
Once configured its as simple as running book <collection-name> where
<collection-name> is the name of one of the collections in your config directory,
for example book personal will open personal.conf. You can pass flags to
the program before the <collection-name> is specified:
Example:
book personal
book -m "tofi" -d "~/.work/book" work