Files
dotfiles/home-modules/home-git-monitor.nix
Lennart J. Kurzweg (Nx2) b1dc30869c rudimentary git_monitor
2024-04-22 18:20:38 +02:00

32 lines
916 B
Nix

{ config, pkgs, ...}:
{
home.packages = with pkgs; [
waybar
(pkgs.writeShellScriptBin "git_monitor" ''
#!/bin/bash
# List of directories to check
directories=(
"$HOME/nix-dots"
"$HOME/shared/HSMW/Praxis/BCAM/bolt-llmserver"
"$HOME/shared/HSMW/Praxis/BCAM/bcam-tools"
)
for dir in "''${directories[@]}"; do
echo "Checking git status in $dir"
# Check if the directory exists
if [ -d "$dir" ]; then
# Change directory and run git status
cd "$dir" || { echo "Cannot change directory to $dir"; exit 1; }
git status
# Change back to the original directory
cd - > /dev/null || { echo "Cannot change back to the original directory"; exit 1; }
else
echo "Directory $dir does not exist."
fi
done
'')
];
}