From cb0e8d0ddf6cf11a103eb35a72b7e7049b87d379 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Tue, 21 Apr 2026 01:23:20 +0100 Subject: feat: add 'just groups' recipe to show per-group install coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shows install status for each meta group: ✓ (green) fully installed ~ (yellow) partially installed ✗ (red) nothing installed --- .github/copilot-instructions.md | 2 +- justfile | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 30c6c19..e82de1e 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -15,7 +15,7 @@ The repo root is a chezmoi source directory. Files targeting `$HOME` use chezmoi - `create-efi.sh` is an interactive EFI boot entry creation script using `efibootmgr`. - `.chezmoiignore` excludes non-home files (`etc/`, `meta/`, `firefox/`, docs) from deployment to `$HOME`. - `.githooks/` contains git hooks (notably `post-commit` which runs `chezmoi apply`). Activate with `just install-hooks`. -- `justfile` provides recipes: `install-hooks`, `apply`, `install`, `install-all`, `add`, `status`. +- `justfile` provides recipes: `install-hooks`, `apply`, `install`, `install-all`, `add`, `status`, `groups`. ## Window manager diff --git a/justfile b/justfile index fe1cc65..fe58d8d 100644 --- a/justfile +++ b/justfile @@ -49,3 +49,23 @@ status: echo "" echo "=== Dotfile drift ===" chezmoi status || true + +# Show install coverage for each group +groups: + #!/bin/sh + for file in meta/*.txt; do + group=$(basename "$file" .txt) + pkgs=$(grep -v '^\s*#' "$file" | grep -v '^\s*$') + total=$(echo "$pkgs" | wc -l) + installed=0 + for pkg in $pkgs; do + pacman -Qi "$pkg" >/dev/null 2>&1 && installed=$((installed + 1)) + done + if [ "$installed" -eq "$total" ]; then + printf ' \033[32m✓\033[0m %-10s %d/%d\n' "$group" "$installed" "$total" + elif [ "$installed" -eq 0 ]; then + printf ' \033[31m✗\033[0m %-10s %d/%d\n' "$group" "$installed" "$total" + else + printf ' \033[33m~\033[0m %-10s %d/%d\n' "$group" "$installed" "$total" + fi + done -- cgit v1.2.3-70-g09d2