Repository navigation
Conversation
Member
|
Using command module means you keep your scripts locally. |
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.
Summary
Adds
sysage, a helper script that detects the system's install date anddisplays its age in human-readable format (e.g.
2 years, 3 months, 15 days (since 2024-08-15)). Designed for use with fastfetch's Command module.Two implementations are provided:
scripts/sysage.sh— portable POSIX shell, zero dependenciesscripts/sysage-go/— Go source (zero external deps), compiles to asingle binary (~11ms runtime)
Also includes
presets/sysage.jsonc, a preset demonstrating usage:{ "type": "command", "key": "System Age", "text": "sysage" }How it works
Probes OS-specific files created at install time (
/etc/machine-id,/var/db/.AppleSetupDone,/entropy, etc.) for both inode birth time andmtime, then takes the oldest valid timestamp. Timestamps before 1991-09-17
(Linux birth) or in the future are rejected as bogus.
Platform support
/etc/machine-id,/etc/hostname,/etc/localtime,/var/log/installer{,/syslog},/var/log/anaconda,//var/db/.AppleSetupDone,/var/db/receipts,SystemVersion.plist/entropy,/etc/hostid,/etc/rc.confContext
This follows from the discussion in #2764 (closed). Rather than a native C
module, this uses the existing Command module infrastructure, which is the
recommended approach for community-contributed system info extensions.