Skip to content

t3m3d/kryofetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kryofetch

A Windows system information fetch tool written in Krypton — a self-hosting language that compiles to machine code.

Krypton 2.0 only. The 2.0 ABI break (per-allocation 16-byte GC headers + Win32 marshalling) is incompatible with 1.x runtimes. Krypton-side source uses the 2.0 calling convention: bufNew(8) + bufGetQword for OUT-pointer handles, no handleInt() wraps on already-itoa'd Win32 returns, toHandle("0") only for NULL pointer args of marshalled calls.

image

Features

  • User — username and hostname
  • OS — Windows version, edition, build number, and architecture
  • CPU — processor name with logical core count
  • RAM — used / total with percentage and usage bar
  • Disk — all drives with used / total and usage bars
  • GPU — name + VRAM total (from SYSTEM\CurrentControlSet\Control\Video registry) and used VRAM bar (from \GPU Adapter Memory(*)\Dedicated Usage PDH counter, vendor-agnostic)
  • Shell — detected shell (PowerShell, cmd, bash, zsh, nushell)
  • Term — terminal emulator + console size when detectable
  • Resolution — primary display resolution
  • Uptime — days, hours, minutes
  • Packages — installed counts (winget, scoop, choco)
  • Theme — Windows light/dark mode and accent color
  • Battery — charge percentage and AC status (laptops only, hidden on desktops)
  • Color palette — 16-color ANSI block palette

Run

kryofetch.exe              # one-shot render
kryofetch.exe --watch      # live re-render every 1000 ms
kryofetch.exe --watch 500  # custom interval (ms)

In --watch mode kryofetch calls gcCollect() (2.0 mark+sweep) after each render so unreachable allocations are reclaimed and the working set stays bounded. The 1.x gcCheckpoint() / gcRestore() arena-rollback approach is not used here: under 2.0 it can clobber heap state used by registry-iteration code on the next pass (manifests as e.g. a phantom GPU2 entry on iteration 2+).

Build

build.bat

Native PE/COFF via the Krypton compiler's Windows backend (x64.k). No gcc, no MinGW, no MSVC. Produces kryofetch.exe alongside a freshly-copied krypton_rt.dll.

Companion DLLs (ckrypton_gui.dll, ckrypton_proc.dll, ckrypton_fs.dll) must sit next to the .exe — copy them from ..\krypton\runtime\ if you don't already have them locally.

Expects the Krypton repo cloned side-by-side as ..\krypton.

Requirements

  • Windows 10 / 11
  • Krypton 2.0 repo cloned to ..\krypton (sibling directory)
  • C:\krypton\bin\x64_host_new.exe must be in lockstep with ..\krypton\compiler\windows_x86\x64_host.exekcc.exe -o shells out to the installed copy. Stale installs cause "should-work" examples to AV.

Notes

kryofetch is short-running (one shot, prints, exits) so it doesn't need to call gcCollect() explicitly. The Krypton 2.0 mark-sweep GC machinery is present but stays inert until program exit, when the OS reclaims the slabs all at once.

The DXGI VRAM-budget path (1.x) is disabled under 2.0: LoadLibraryA + GetProcAddress + COM vtable dispatch is fragile under the new Win32 marshalling table because HMODULE flows as raw char* through both calls. Registry covers VRAM totals; PDH covers usage.

About

A terminal fetch program written in krypton-lang.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages