feat: auto zellij script

This commit is contained in:
Gerg-L 2025-05-22 20:48:41 -04:00
parent 3295aa7421
commit c0ca8281f3
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI
2 changed files with 66 additions and 0 deletions

View file

@ -130,6 +130,27 @@
silent = true;
};
zsh = {
interactiveShellInit =
let
monitorScript = pkgs.replaceVarsWith {
src = ./monitor.ps;
replacements = builtins.mapAttrs (_: lib.getExe) {
inherit (pkgs) perl xdotool;
};
isExecutable = true;
};
in
''
if [[ -z "$ZELLIJ" ]]; then
MONITOR="$(${monitorScript} || true)"
zellij attach -c "''${MONITOR:+"$MONITOR@"}$USER"
exit
fi
'';
};
nix-index = {
enable = true;
package = nix-index-database.packages.nix-index-with-db;