Babashka has unlocked clojure in all the places you might otherwise reach for bash.
Clojure is now more than just feasible for one-off scripts and command line tools!
Babashka now supports a bb.edn, which can specify deps for local babashka tasks.
Tasks can be defined in the bb.edn, either in-line or as a reference to another file (e.g. tasks.clj).
bb [task]
is
even supported on the command line, with zsh
autocompletion!
I'm finally sponsoring some folks for their open source work with (small) monthly donations - just a way to say thanks for tools I use all day, every day.
So you want to create a quick native dashboard. You know enough web dev to be dangerous, and now you're hoping to create something useful that isn't stuck in one of your browser tabs.
Here I'll touch on the path I took through Electron that eventually lead to Tauri, then include links to the way I'm currently using Tauri in Clawe.
Ralphie is a library for useful clojure / babashka apis.
It provides namespaces and functions for integrating with whatever tools I use.
The gist: bash-like scripting and automation libraries via babashka and repl -driven development.
Originally targetted linux cli helpers, but expanded to some osx use-cases as well.
Example namespaces: emacs, tmux, browser, git, spotify, rofi.
babashka/cli
is a few input arg parsers/coercers
and babashka
features (
-x my-ns/my-func
) that make it dead simple to call a
clojure function with coerced args on the command
line.
I just refactored my clawe app-toggle on osx, and it's now just one function
called with a bunch of different args in my yabai keybindings:
# emacs, term toggling
shift + cmd - return : bb --config ~/russmatney/clawe/bb.edn -x clawe.toggle/toggle-app --client emacs --app Emacs
cmd - return : bb --config ~/russmatney/clawe/bb.edn -x clawe.toggle/toggle-app --client terminal --app Alacritty
cmd - u : bb --config ~/russmatney/clawe/bb.edn -x clawe.toggle/toggle-app --wsp journal --title journal --app Emacs
cmd - t : bb --config ~/russmatney/clawe/bb.edn -x clawe.toggle/toggle-app --wsp web --app Safari
cmd - b : bb --config ~/russmatney/clawe/bb.edn -x clawe.toggle/toggle-app --wsp devweb --app "Firefox Developer Edition"
cmd - s : bb --config ~/russmatney/clawe/bb.edn -x clawe.toggle/toggle-app --wsp spotify --app Spotify
cmd - e : bb --config ~/russmatney/clawe/bb.edn -x clawe.toggle/toggle-app --wsp aseprite --app Aseprite
cmd - a : bb --config ~/russmatney/clawe/bb.edn -x clawe.toggle/toggle-app --wsp slack --app Slack
cmd - m : bb --config ~/russmatney/clawe/bb.edn -x clawe.toggle/toggle-app --wsp messages --app Messages
cmd - g : bb --config ~/russmatney/clawe/bb.edn -x clawe.toggle/toggle-app --wsp godot --app Godot
A video overview of the components that make up the clawe monorepo.
Relevant April 2023.
I'll post a link here once it exists! For now, if you're reading this, I could stream this any day, so take a look at my schedule or ping me to see when it's going to happen.