yrwq@site:~/yafetch.mdx
yrwq@site:~/projects$ cat yafetch.mdx

yafetch

minimal system info tool written in Rust, configured in Lua

active
rust
lua

source

unlike other fetch tools that force you into a config format, yafetch just gives you raw lua. your config file is a real script. use variables, loops, conditionals, math. it runs, prints output, exits. fast because it's rust, flexible because it's lua.

yafetch            # uses ~/.config/yafetch/init.lua
yafetch fetch.lua  # custom config path

example output (from the default config):

yrwq@myhost
distro    Arch Linux
host      ThinkPad X1 Carbon Gen 10
uptime    2h 34m
kernel    6.8.7-arch1-1
cpu       Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
disk      42gb / 256gb
memory    3.2gb / 16gb

the exact output depends on whatever lua you write. colors, layout, spacing, what info to show, all controlled from your script.

install:

git clone https://github.com/yrwq/yafetch && cd yafetch
cargo build --release
sudo cp target/release/yafetch /usr/bin
mkdir -p ~/.config/yafetch
cp examples/sample.lua ~/.config/yafetch/init.lua

lua api

every function lives under the global yafetch table:

functionreturnssource
yafetch.os()OS namesysinfo
yafetch.kernel()kernel releasesystemstat
yafetch.host()device modelmachine-info
yafetch.hostname()system hostnamegethostname
yafetch.user()current user$USER
yafetch.uptime()uptime stringsystemstat
yafetch.cpu()cpu brandsysinfo
yafetch.mem_used()used ram (gb)sysinfo
yafetch.mem_total()total ram (gb)sysinfo
yafetch.disk_total(path)total space (gb)fs2
yafetch.disk_free(path)free space (gb)fs2

real config

this is the default sample.lua from the repo:

local red = "\27[31m"
local grn = "\27[32m"
local yel = "\27[33m"
local blu = "\27[34m"
local mag = "\27[35m"
local wht = "\27[37m"
local bold = "\27[1m"
local res = "\27[0m"
 
local header = bold .. mag .. yafetch.user() .. res .. bold .. "@" .. bold .. mag .. yafetch.hostname() .. res
 
local used_ssd = yafetch.disk_total("/") - yafetch.disk_free("/")
 
print(header)
print(yel .. "distro    " .. res .. bold .. yafetch.os() .. res)
print(yel .. "host      " .. res .. bold .. yafetch.host() .. res)
print(yel .. "uptime    " .. res .. bold .. yafetch.uptime() .. res)
print(yel .. "kernel    " .. res .. bold .. yafetch.kernel() .. res)
print(yel .. "cpu       " .. res .. bold .. yafetch.cpu() .. res)
print(yel .. "disk      " .. res .. bold .. used_ssd .. "gb  / " .. yafetch.disk_total("/") .. "gb" .. res)
print(yel .. "memory    " .. res .. bold .. yafetch.mem_used() .. "gb / " .. yafetch.mem_total() .. "gb" .. res)
main
9