forked from nzuum/fetchit
fastfetch alternative configurable in lua
- C 85.4%
- Nix 7.4%
- Makefile 4.6%
- Lua 2.6%
| assets | chore: add openbsd 3 clause license | |
| config | chore: add default config | |
| src | chore: rewrote minor stuff on the readme | |
| .clangd | chore: lsp setup | |
| .gitignore | chore: ignore nix result directory | |
| compile_commands.json | chore: lsp setup | |
| flake.lock | chore: add flake.lock | |
| flake.nix | chore(flake.nix): add pciutils as runtime dependency | |
| LICENSE | chore: add license header | |
| Makefile | chore: makefile actually fixed (thanks dacctal) | |
| README.md | chore: rewrote minor stuff on the readme | |
fetchit
a minimal system info fetcher written in C and configurable in lua
build it
git clone https://codeberg.org/nzuum/fetchit
cd fetchit
sudo make install
make install-config
configure it
fetchit will copy the init.lua and logos/logo.txt into your ~/.config/fetchit folder on install
column_padding = 2
art = {
source = "./logos/logo.txt"
}
function fetch()
return {
columns = {
art.out,
{
color.red(user.name .. "@" .. host.name),
color.red("os: ") .. string.lower(os.name),
color.yellow("kernel: ") .. "linux " .. kernel.release,
color.green("cpu: ") .. string.lower(cpu.name),
color.blue("gpu: ") .. string.lower(gpu.name),
color.magenta("ram: ") .. string.format("%.1fGB/%.1fGB (%.1f%%)", memory.used_gb, memory.total_gb, memory.percent),
}
}
}
end
the default config only uses a few of the modules that fetchit exposes to the lua state. for a full list, look below
learn it
host
host.name
user
user.name
os
os.name
kernel
kernel.release
cpu
cpu.name
gpu
gpu.name
memory
-- it is recommended to format x_gb. i.e: string.format(%.1fgb, memory.toal_gb)
memory.total_gb
memory.used_gb
memory.available_gb
memory.percent
disk
-- it is recommended to format x_gb. i.e: string.format(%.1fgb, disk.total_gb)
disk.total_gb
disk.used_gb
vendor
vendor.name
vendor.model
uptime
uptime.pretty -- 12h 6m
uptime.seconds -- 43560
shell
shell.name
terminal
terminal.name
art
art source is to be specified in the config file. the path is relative to the config's location
art = {
source = "path/to/file"
}
color
color.black()
color.red()
color.green()
color.yellow()
color.blue()
color.magenta()
color.cyan()
color.white()
color.bright_black()
color.bright_red()
color.bright_green()
color.bright_yellow()
color.bright_blue()
color.bright_magenta()
color.bright_cyan()
color.bright_white()
color.bold()
color.reset()