Repository navigation
feat: add per-module label, value and command overrides - #6
Merged
Merged
Conversation
Rename a built-in row, replace its reading with fixed text, or take its value from a shell command, under [overrides.<module>]. Custom rows can now take a command as well as a value. - label is display-only: a row keeps its icon, place and live updates - value/command replace the row's figures with plain text, and the row is no longer refreshed by --live - commands run once at startup through sh -c, all together, so the wait is the slowest one; nothing printed or past command_timeout (default 1s) leaves the row out - output is the first non-empty line with control characters removed - config errors now say which line the mistake is on - one shared process runner for these commands and the version probes Fixes #5
my_github_cli reports the shields.io badges in the README as broken links and fails the check. The job is skipped until the tool is updated.
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.
Fixes #5
Adds the fastfetch-style overrides asked for in #5: rename a built-in row, replace its reading with a string, or take its value from a command.
Config
New key:
command_timeout(default 1s, clamped to 0.1-10).Behaviour
labelis display-only. The row keeps its icon, its place and its--liveupdates.iconicandtreeprint no names, so a rename does not show there.value/commandreplace the row's figures and bars with plain text, and the row is excluded from--liverefresh so it is not overwritten.batteryon a desktop) still shows the user's text if they override it.sh -cwith the user's privileges, all started together, so the wait is the slowest one rather than the sum. Only the first non-empty line is used, with control characters stripped. Nothing printed, or longer thancommand_timeout, leaves the row out.valuewithcommand, empty table, empty label, overridingcolors/custom) are reported at load, and config errors now include the line number.custom = [{ label, value }]parses as before.Implementation
src/rows.rs:Source,CustomRow,Override, validated at parse time.src/fetch/command.rs: the one process runner (deadline, process group kill, output cap), now shared with the version probes indetail.rs.Itemgains a private display name next to its identitylabel; styles use it where they print a label.fetch::gatherplans the rows first so every command can start before any is waited on.Testing
--no-default-features), including a width sweep of long custom names across every style and tests that a refresh never overwrites an override.-D warningsandcargo doc -D warningsclean on 1.98.1 and a recent nightly; macOS targets compile.