feat(fastfetch): add cached update, reboot and ansible-pull status modules - #601
Merged
Conversation
…dules Adds self-hiding fastfetch modules that surface available package updates, a pending reboot, and (on hosts managed by DevSecNinja/docker ansible-pull) the last ansible-pull run status. status.sh reads a small cache and refreshes it in a fully detached background process (stale-while-revalidate), so shell login stays fast; it never needs root or the network. Update checks cover apt, dnf, pacman, zypper, apk and brew (macOS/Linuxbrew). Empty output makes a line disappear, so each line only shows when relevant. Windows keeps its default fastfetch config via .chezmoiignore. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends fastfetch with three self-hiding status lines:
ansible-pullrun status for hosts managed by the DevSecNinja/docker project (OK/FAILED, last-run age, next run, config SHA)A line only appears when there's something to report (fastfetch hides a
commandmodule that prints nothing), so an up-to-date, unmanaged host looks exactly like before.Files
home/dot_config/fastfetch/executable_status.sh→~/.config/fastfetch/status.shhome/dot_config/fastfetch/config.jsonc— default layout + the 3commandmoduleshome/.chezmoiignore— skip this bash-driven dir on Windowstests/bash/fastfetch-status.bats— 15 testsPerformance (runs on every shell login)
Section commands only
cata small cache under~/.cache/fastfetch-status/. When the cache is stale (TTL default 1h) they print the current value instantly and spawn a fully-detached backgroundrefresh(stale-while-revalidate). The expensive work needs no root and no network and never runsapt update. Verified: full render stays ~300ms even while a refresh runs in the background.Update checks cover
apt,dnf,pacman,zypper,apk(Linux) andbrew(macOS / Linuxbrew). Reboot detection is Linux-only.Tunables
FASTFETCH_STATUS_TTL,FASTFETCH_STATUS_DISABLE=1,ANSIBLE_PULL_WORKDIR;status.sh refresh --force/clear.Testing
./tests/bash/run-tests.sh --test fastfetch-status.bats→ 15/15 pass