<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ooonea.eth</title>
    <description>The latest articles on DEV Community by ooonea.eth (@ooonea).</description>
    <link>https://dev.to/ooonea</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F351623%2F609834de-4d0b-4028-8e8f-4f714134336f.png</url>
      <title>DEV Community: ooonea.eth</title>
      <link>https://dev.to/ooonea</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ooonea"/>
    <language>en</language>
    <item>
      <title>purefetch: a fastfetch-style system info tool in Rust with zero dependencies</title>
      <dc:creator>ooonea.eth</dc:creator>
      <pubDate>Sat, 04 Jul 2026 15:45:04 +0000</pubDate>
      <link>https://dev.to/ooonea/purefetch-a-fastfetch-style-system-info-tool-in-rust-with-zero-dependencies-19f0</link>
      <guid>https://dev.to/ooonea/purefetch-a-fastfetch-style-system-info-tool-in-rust-with-zero-dependencies-19f0</guid>
      <description>&lt;p&gt;I like &lt;code&gt;neofetch&lt;/code&gt; / &lt;code&gt;fastfetch&lt;/code&gt;, but I wanted one with a genuinely &lt;em&gt;empty&lt;/em&gt;&lt;br&gt;
dependency graph — nothing pulled from crates.io. So I built &lt;strong&gt;purefetch&lt;/strong&gt;: a small&lt;br&gt;
system-info fetcher written entirely in Rust using only &lt;code&gt;std&lt;/code&gt; plus raw Linux&lt;br&gt;
syscalls.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Disclosure up front:&lt;/strong&gt; purefetch was built largely with &lt;strong&gt;AI assistance&lt;/strong&gt;&lt;br&gt;
(Claude Code). I directed the design, and every change was reviewed and tested —&lt;br&gt;
including running it on four architectures under QEMU — but most of the code is&lt;br&gt;
AI-generated. I'd rather be honest about that than pretend otherwise.&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;       _,met$$$$$gg.          ooonea@unicorn
    ,g$$$$$$$$$$$$$$$P.       ──────────────
  ,g$$P"     """Y$$.".        OS        Debian GNU/Linux 13.5 (trixie) x86_64
 ,$$P'              `$$$.     Host      ThinkPad P53 (20QQS0JD01)
',$$P       ,ggs.     `$$b:   Kernel    6.12.94+deb13-amd64
`d$$'     ,$P"'   .    $$$    Uptime    6 days, 15 hours, 30 mins
 $$P      d$'     ,    $$P    Packages  2477 (dpkg), 1 (flatpak)
 $$:      $$.   -    ,d$$'    Shell     zsh 5.9
 $$;      Y$b._   _,d$P'      Display   1920x1080 (eDP-1)
 Y$$.    `.`"Y$$$$P"'         DE        GNOME 48.7
 `$$b      "-.__              WM        Mutter (Wayland)
  `Y$$                        Terminal  kitty 0.41.1
   `Y$$.                      CPU       Intel(R) Core(TM) i7-9850H @ 4.60 GHz
     `$$b.                    GPU       Quadro RTX 3000
       `Y$$b.                 Memory    15.28 GiB / 62.61 GiB (24%)
          `"Y$b._             Swap      0 B / 8.00 GiB (0%)
              `"""            Disk (/)  8.52 GiB / 489.57 GiB (2%)
                              Locale    en_US.UTF-8
                              Battery   76% (Not charging)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Zero dependencies, really
&lt;/h2&gt;

&lt;p&gt;No &lt;code&gt;libc&lt;/code&gt; crate, no &lt;code&gt;sysinfo&lt;/code&gt;, no &lt;code&gt;nix&lt;/code&gt;, no color crate — nothing from crates.io.&lt;br&gt;
Almost everything is just reading and parsing &lt;code&gt;/proc&lt;/code&gt; and &lt;code&gt;/sys&lt;/code&gt;. The result is a&lt;br&gt;
single &lt;strong&gt;~484 KiB&lt;/strong&gt; binary that builds offline.&lt;/p&gt;

&lt;p&gt;The only things &lt;code&gt;std&lt;/code&gt; can't do are &lt;code&gt;statfs&lt;/code&gt; (disk usage) and &lt;code&gt;ioctl&lt;/code&gt; (terminal size&lt;br&gt;
/ tty check). Instead of pulling in a binding crate, those are issued as &lt;strong&gt;raw Linux&lt;br&gt;
syscalls&lt;/strong&gt; via &lt;code&gt;core::arch::asm!&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[cfg(target_arch&lt;/span&gt; &lt;span class="nd"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"x86_64"&lt;/span&gt;&lt;span class="nd"&gt;)]&lt;/span&gt;
&lt;span class="k"&gt;unsafe&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;syscall3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;usize&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;usize&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;usize&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;usize&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;isize&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;ret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;isize&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nn"&gt;core&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;arch&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nd"&gt;asm!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s"&gt;"syscall"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nf"&gt;inlateout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"rax"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;isize&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"rdi"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;a1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"rsi"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;a2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"rdx"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;a3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nf"&gt;out&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"rcx"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;out&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"r11"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nf"&gt;options&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nostack&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;ret&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Four architectures
&lt;/h2&gt;

&lt;p&gt;Each architecture gets its own &lt;code&gt;syscall3&lt;/code&gt; (a different instruction and register&lt;br&gt;
convention) plus its syscall numbers. aarch64, riscv64 and loongarch64 share the&lt;br&gt;
"asm-generic" table (&lt;code&gt;statfs = 43&lt;/code&gt;, &lt;code&gt;ioctl = 29&lt;/code&gt;); x86_64 has its own.&lt;/p&gt;

&lt;p&gt;I validated all four &lt;strong&gt;end-to-end under &lt;code&gt;qemu-user&lt;/code&gt;&lt;/strong&gt; — cross-compiling to each&lt;br&gt;
target and actually &lt;em&gt;running&lt;/em&gt; the binary to confirm the raw syscalls work, not just&lt;br&gt;
that they compile. Seeing the aarch64 build print correct disk and memory numbers&lt;br&gt;
under QEMU was a nice moment.&lt;/p&gt;

&lt;h2&gt;
  
  
  A ZFS gotcha worth knowing
&lt;/h2&gt;

&lt;p&gt;On ZFS-on-root, a naive &lt;code&gt;MemTotal - MemAvailable&lt;/code&gt; massively over-reports used RAM,&lt;br&gt;
because the ZFS ARC is kernel-slab cache that &lt;code&gt;MemAvailable&lt;/code&gt; doesn't count as&lt;br&gt;
reclaimable. purefetch subtracts the reclaimable ARC (&lt;code&gt;arcstats size - c_min&lt;/code&gt;),&lt;br&gt;
which lines up with what &lt;code&gt;fastfetch&lt;/code&gt; and ZFS-aware &lt;code&gt;htop&lt;/code&gt; show. On my box that's the&lt;br&gt;
difference between "37 GiB used" (wrong) and "15 GiB used" (right).&lt;/p&gt;

&lt;h2&gt;
  
  
  The logo generator (and a bug it introduced)
&lt;/h2&gt;

&lt;p&gt;The 24 distro logos live as plain text in &lt;code&gt;assets/logos/*.txt&lt;/code&gt;, and a small Python&lt;br&gt;
script generates &lt;code&gt;src/logo.rs&lt;/code&gt;. Adding a logo is one text file plus a regen.&lt;/p&gt;

&lt;p&gt;It also taught me a lesson. An early version of the generator emitted the color as&lt;br&gt;
&lt;code&gt;sgr: "215;7;81"&lt;/code&gt; instead of &lt;code&gt;"38;2;215;7;81"&lt;/code&gt; — dropping the truecolor prefix. The&lt;br&gt;
terminal then read &lt;code&gt;\e[215;7;81m&lt;/code&gt; as "code 215 (ignored) + 7 (reverse video)", so&lt;br&gt;
every logo rendered washed-out instead of its brand color. I missed it because my&lt;br&gt;
render checks all ran with &lt;code&gt;--no-color&lt;/code&gt;. Fixed in 0.1.2 — a good reminder to test the&lt;br&gt;
thing your users actually &lt;em&gt;see&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;purefetch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Source, issues and PRs: &lt;strong&gt;&lt;a href="https://github.com/ooonea/purefetch" rel="noopener noreferrer"&gt;https://github.com/ooonea/purefetch&lt;/a&gt;&lt;/strong&gt; (MIT OR Apache-2.0).&lt;br&gt;
New distro logos and extra architectures are especially welcome — and I'm happy to&lt;br&gt;
talk about the raw-syscall approach, or the AI-assisted workflow, in the comments.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>cli</category>
      <category>linux</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
