feat(darwin)!: rewrite sketchybar config

- 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`)
This commit is contained in:
reo101 2024-09-08 16:45:11 +03:00
parent 31f9e7dbef
commit 10a013d6a6
Signed by: reo101
GPG key ID: 675AA7EF13964ACB
5 changed files with 266 additions and 163 deletions
modules/nix-darwin/yabai

View file

@ -36,24 +36,46 @@ in
${builtins.readFile ./yabairc}
# Load JankyBorders
${borders}/bin/borders active_color=0xffe1e3e4 inactive_color=0xff494d64 width=5.0 &
${borders}/bin/borders active_color=0xffe1e3e4 inactive_color=0xff494d64 style=squared width=5.0 &
'';
};
skhd = {
enable = true;
package = pkgs.skhd;
skhdConfig = (builtins.readFile ./skhdrc);
skhdConfig = builtins.readFile ./skhdrc;
};
sketchybar = {
enable = true;
# sketchybar = {
# enable = true;
# package = pkgs.sketchybar;
# extraPackages = with pkgs; [
# jq
# ];
# config = import (lib.getExe (pkgs.callPackage ./sketchybar { }));
# };
};
# TODO: make builtin module work with scripts
launchd.user.agents.sketchybar = let
cfg = rec {
package = pkgs.sketchybar;
extraPackages = with pkgs; [
jq
];
config = import ./sketchybar pkgs;
configFile = lib.getExe (pkgs.callPackage ./sketchybar { sketchybar = package; });
};
in {
path = [ cfg.package ] ++ cfg.extraPackages ++ [ config.environment.systemPath ];
serviceConfig.ProgramArguments =
[
"${lib.getExe cfg.package}"
] ++ optionals (cfg.configFile != null) [
"--config"
"${cfg.configFile}"
];
serviceConfig.KeepAlive = true;
serviceConfig.RunAtLoad = true;
};
# For sketchybar