Add fastfetch binary: system information fetcher#69
Merged
jiacai2050 merged 8 commits intomainfrom Mar 16, 2026
Merged
Conversation
Co-authored-by: jiacai2050 <3848910+jiacai2050@users.noreply.github.com>
Co-authored-by: jiacai2050 <3848910+jiacai2050@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add port for fastfetch
Add fastfetch binary: system information fetcher
Mar 16, 2026
Owner
|
@copilot fix conflict. |
…lot/port-fastfetch # Conflicts: # build.zig
Contributor
Author
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new fastfetch CLI binary to the Zig toolkit to print basic system information (OS, kernel, uptime, shell, CPU, memory), with Linux /proc-based collection and macOS sysctl-based collection, and wires it into the build.
Changes:
- Introduces
src/bin/fastfetch.zigimplementing thefastfetchcommand plus unit tests forformatUptimeandparseKbLine. - Registers
fastfetchinbuild.zigand conditionally links libc for macOS builds.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/bin/fastfetch.zig | New fastfetch binary implementation + helper-function tests. |
| build.zig | Adds fastfetch to the build and applies platform-specific build/link behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+248
to
+255
| } else if (std.mem.eql(u8, name, "fastfetch")) { | ||
| if (is_win) { | ||
| return null; | ||
| } | ||
| // macOS sysctl requires libc; Linux uses /proc and needs no extra library. | ||
| if (is_darwin) { | ||
| exe.linkLibC(); | ||
| } |
Expand fastfetch output with host model, disk usage, display resolution, battery, and theme. Add cross-platform C imports and correct framework linking on macOS. Improve CPU, memory, and uptime reporting to show more details and handle both Linux and macOS OS-specific fields. This change allows users to quickly view comprehensive hardware and OS information, motivating the update to facilitate troubleshooting and system inventory.
Introduce documentation for fastfetch, including usage examples, key features, and output demonstration. This provides new and existing users with a clear overview of fastfetch's capabilities and platform support, enhancing accessibility and understanding without requiring inspection of the source code.
Add "fastfetch" to the build blacklist to prevent compilation on non-Darwin systems. This change ensures platform-specific targets are handled consistently and avoids build errors caused by unsupported executables.
Show monitor refresh rate in resolution info on macOS, providing users a more accurate overview of display settings. Improves UX for those needing detailed screen specs.
7892e70 to
da5862b
Compare
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.
Ports the fastfetch concept to Zig as a new
fastfetchCLI binary in the toolkit.What it shows
Implementation
src/bin/fastfetch.zig— new binary with platform-specific data collection:/proc/uptime,/proc/cpuinfo,/proc/meminfo,/etc/os-release— no extra library needed@cImport+linkLibC()forsysctlcalls (kern.boottime,kern.osproductversion,machdep.cpu.brand_string,hw.memsize). The@cImportis guarded by a top-levelcomptime if (native_os == .macos)so Linux builds never touch those headers.nullfrommakeCompileStep)build.zig— registersfastfetchin the binary list; addslinkLibC()for macOS; returnsnullon WindowsTests
Unit tests for the two pure helper functions:
formatUptime(all four time-scale branches) andparseKbLine(/proc/meminfoline parser).Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.