reo101
10a013d6a6
- Now written in `Clojure`, using `Babashka` Checked with `clj-kondo` - Add TODO for module upstreaming (of allowing file or script for `config`) - Set `yabai` `window_border_radius` to `0` - Fix ` battery` script (`grep` does not do `\d`)
45 lines
1.3 KiB
Nix
Executable file
45 lines
1.3 KiB
Nix
Executable file
# TODO: AppleSelectedInputSourcesChangedNotification
|
|
{ lib, darwin, writeShellApplication, sketchybar, babashka, clj-kondo, ... }:
|
|
|
|
let
|
|
plugin-dir = ./plugins;
|
|
util-dir = ./utils;
|
|
get-menu-bar-height = darwin.apple_sdk.stdenv.mkDerivation {
|
|
name = "get_menu_bar_height";
|
|
version = "0.0.1";
|
|
src = lib.cleanSource ./get_menu_bar_height;
|
|
buildInputs = with darwin.apple_sdk.frameworks; [
|
|
Cocoa
|
|
];
|
|
buildPhase = ''
|
|
clang -framework cocoa get_menu_bar_height.m -o get_menu_bar_height
|
|
'';
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
mv get_menu_bar_height $out/bin/get_menu_bar_height
|
|
'';
|
|
meta.mainProgram = "get_menu_bar_height";
|
|
};
|
|
sketchybar-config-script = ./config.clj;
|
|
in
|
|
writeShellApplication {
|
|
name = "sketchybar-config";
|
|
text = ''
|
|
export PLUGIN_DIR="${plugin-dir}"
|
|
export UTIL_DIR="${util-dir}"
|
|
|
|
exec ${lib.getExe babashka} \
|
|
--file ${sketchybar-config-script} \
|
|
--plugin-dir ${plugin-dir} \
|
|
--util-dir ${util-dir} \
|
|
--get-menu-bar-height ${lib.getExe get-menu-bar-height}
|
|
'';
|
|
runtimeInputs = [
|
|
sketchybar
|
|
];
|
|
checkPhase = ''
|
|
${lib.getExe clj-kondo} \
|
|
--config '{:linters {:namespace-name-mismatch {:level :off}}}' \
|
|
--lint ${sketchybar-config-script}
|
|
'';
|
|
}
|