Skip to content

Scripts: add sysage helper for system install date - #2769

Closed
DavCyril wants to merge 1 commit into
fastfetch-cli:devfrom
DavCyril:feature/sysage-helper
Closed

DavCyril wants to merge 1 commit into
fastfetch-cli:devfrom
DavCyril:feature/sysage-helper

Conversation

@DavCyril

Copy link
Copy Markdown

Summary

Adds sysage, a helper script that detects the system's install date and
displays 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 dependencies
  • scripts/sysage-go/ — Go source (zero external deps), compiles to a
    single 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 and
mtime, then takes the oldest valid timestamp. Timestamps before 1991-09-17
(Linux birth) or in the future are rejected as bogus.

Platform support

Platform Candidates probed
Linux /etc/machine-id, /etc/hostname, /etc/localtime, /var/log/installer{,/syslog}, /var/log/anaconda, /
macOS /var/db/.AppleSetupDone, /var/db/receipts, SystemVersion.plist
FreeBSD/DragonFly /entropy, /etc/hostid, /etc/rc.conf

Context

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.

@CarterLi

Copy link
Copy Markdown
Member

Using command module means you keep your scripts locally.

@CarterLi CarterLi closed this Nov 30, 2026
@DavCyril
DavCyril deleted the feature/sysage-helper branch November 30, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants