Please be kind!
Teodor
I gave up on managing bookmarks in web browsers long ago.
But I was thinking. We’re able to take care of source code. Improve it over time. And we’ve got this amazing thing called version control. And this other amazing thing called data. So why not combine them.
Bookmarks are just data.
But! Opening a bookmark must be nice. Run a command, select the bookmark, open in browser.
So I made a thing. Use it like this:
$ bink
in a terminalBut the bookmarks are just a bunch of EDN files you can structure
yourself in ~/.config/bink/provider/
.
Here’s an example:
;; from ~/.config/bink/provider/links.edn on my computer:
:links [{:title "Clojure Deref" :href "https://clojure.org/news/news"}
{:title "Clojureverse" :href "https://clojureverse.org/"}]} {
If you want to try it out, that’s awesome.
To add a bookmark, edit your link files. You can use as many files as
you want. Just make sure the suffix is .edn
.
Feel free to bug me about it on the babashka channel on the Clojurians Slack.
Teodor (https://teod.eu)
Here’s a small install script: https://github.com/teodorlu/play.teod.eu/blob/master/bink/install.sh
Or install it with bbin:
$ bbin install https://play.teod.eu/bink/bink.clj
$ bink
TODO:
babashka.process/shell
or other things…
bink
has the potential to
remove real friction for teams with lots of scattered resources, and
remove friction jumping from place to place
fzf
or
rofi
or other things, user choiceyour.domain/links.json
or your.domain/links.edn
might be an interesting
convention.
babashka.org/links.edn
could link to
babashka-related resources
Feel free to ignore this part :)
# To open a link:
$ bink
# Select link with fzf
# Then it's opened in your browser.
# Add a link
$ bink add "Clojure Deref" https://clojure.org/news/news
Nice to have / later: link providers. I could fetch links from multiple sources. Use one source with my team at work. Another for personal stuff.
A link provider could be an EDN file, a JSON file, an SQLite DB, an URL or a system command.
But! Let’s not start there. Or … It would be nice to be able to just symlink multiple files / programs into ~/.local/share/bink/providers.d/
Hmmm.
Path | Purpose |
---|---|
~/.config/bink/config.edn |
Bink main configuration file |
~/.config/bink/provider/* |
Additional link providers |
JSON file - interpret as JSON. EDN file - interpret as EDN.
What about programs? If they are executable, perhaps they should be run?
Perhaps an executable links.json
should
output JSON links on stdout. 🤔
EDN:
:links [{:title "Clojure Deref" :href "https://clojure.org/news/news"}
{:title "Clojureverse" :href "https://clojureverse.org/"}]} {
JSON:
{
"links": [
{"title": "Clojure Deref", "href": "https://clojure.org/news/news"},
{"title": "Clojureverse", "href": "https://clojureverse.org/"}
]
}
Idea: different providers in bink config.
Example configuration:
:providers {clojure-community {:edn-file
{:path "~/.config/bink/provider/clojure.edn"}}
{:fn
stuff-from-work {fn []
(
(cheshire.core/parse-stringslurp "https://iterb.art/data/links.json")
(keyword))}}}
But. What do we do if loading all the links takes time? Do we cache? Or do we allow the slowdown?
If we select provider first then select link, we might not care too much about load time.
Hmm, that’s actually a very good idea.
And I want to configure which browser to use
I could extend the current thing.
:providers {clojure-community {:file "~/.config/bink/provider/clojure.edn"
{:open-fn (fn [{:keys [href]}]
(clojure.java.browse/browse-url href))}:fn (fn []
teod-play {
(clojure.edn/read-stringslurp "https://play.teod.eu/links.edn")))
(:open-fn (fn [{:keys [href]}]
"firefox" "-new-window" href]))}
(babashka.process/process [:fn
stuff-from-work {fn []
(
(cheshire.core/parse-stringslurp "https://iterb.art/data/links.json")
(keyword))}}}