Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 48 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ratfetch"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
# Set by ratatui 0.30, which is the highest MSRV in the dependency tree.
rust-version = "1.88"
Expand All @@ -17,11 +17,14 @@ include = ["src/**", "assets/**", "build.rs", "README.md", "LICENSE"]

[dependencies]
clap = { version = "4.6", features = ["derive"] }
clap_complete = "4.6"
clap_mangen = "0.2"
crossterm = "0.29"
dirs = "6.0"
libc = "0.2"
ratatui = "0.30"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
toml = "1.1"

[build-dependencies]
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ process table, filesystems and interfaces, all refreshing while you watch.
## What it does

- **Live, not a snapshot.** Everything re-reads on a configurable interval.
- **526 logos**, the full set vendored from fastfetch, with their original
- **527 logos**, the full set vendored from fastfetch, with their original
colour palettes. Auto-detected from `/etc/os-release`, or pick your own.
- **Four tabs** — overview, processes, filesystems, interfaces.
- **13 built-in themes**, plus per-role colour overrides. The default is
Expand Down Expand Up @@ -75,6 +75,11 @@ ratfetch --once # one frame, like a classic fetch tool
ratfetch --logo nixos # override the detected logo
ratfetch --theme gruvbox-dark
ratfetch --interval 250 # four samples a second
ratfetch --format json # one machine-readable snapshot
ratfetch --format plain # clean line-oriented output
ratfetch --diagnose # explain unavailable collectors
ratfetch --generate-completion fish
ratfetch --generate-man ratfetch.1
ratfetch --list-logos | fzf # browse what is bundled
```

Expand All @@ -90,9 +95,17 @@ ratfetch --list-logos | fzf # browse what is bundled
| `c` | per-core CPU meters |
| `space` | freeze / resume |
| `r` | reload the config |
| `/` / `ctrl+u` | filter / clear the process list |
| `enter` / `t` | process details / tree view |
| `x` | confirm and send SIGTERM to the selected process |
| `i` / `e` | full system information / error history |

All of them are rebindable.

The process table keeps a visible selection and scrollbar. Mouse clicks switch
tabs, and short split panes automatically prioritize information and meters
over decorative art and graphs.

## Configuration

```sh
Expand Down
16 changes: 12 additions & 4 deletions assets/config.template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ watch_config = true
[logo]
# "auto" detects the distro. Otherwise a logo name ("arch", "nixos", "debian"),
# "none", or "file:/path/to/your/art.txt". Run `ratfetch --list-logos` to see
# all 526 of them.
# all 527 of them.
source = "auto"
# Prefer the compact variant when the logo ships one.
small = false
Expand Down Expand Up @@ -119,7 +119,8 @@ colors = 3
# Rows of the info table, in order. Available rows:
# title, separator, blank, os, host, kernel, uptime, packages, shell,
# terminal, de, wm, resolution, cpu, cpu_temp, gpu, memory, swap, disk,
# local_ip, battery, load_avg, processes, users, locale, date_time, colors
# local_ip, local_ipv6, battery, load_avg, processes, users, locale, date_time,
# colors
items = [
"title",
"separator",
Expand Down Expand Up @@ -154,7 +155,7 @@ bold_title = true
hide_empty = true

[meters]
# Live bars. Available: cpu, memory, swap, disk, battery, load.
# Live bars. Available: cpu, memory, swap, disk, battery, load, gpu.
items = ["cpu", "memory", "swap", "disk"]
# bar, line, blocks, or dots.
style = "bar"
Expand All @@ -169,7 +170,7 @@ label_width = 8
per_core = false

[graphs]
# Time series. Available: cpu, memory, swap, network, disk, load.
# Time series. Available: cpu, memory, swap, network, disk, disk_io, load, gpu.
items = ["cpu", "memory", "network"]
# sparkline, braille, or bars.
style = "sparkline"
Expand Down Expand Up @@ -229,3 +230,10 @@ scroll_up = ["up", "k"]
sort_next = ["s"]
toggle_per_core = ["c"]
freeze = ["space"]
info_details = ["i"]
errors = ["e"]
search_processes = ["/"]
clear_process_filter = ["ctrl+u"]
process_details = ["enter"]
process_tree = ["t"]
signal_process = ["x"]
18 changes: 8 additions & 10 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ fi

need tar
need mktemp
need sha256sum

# --- which version ----------------------------------------------------------

Expand Down Expand Up @@ -95,16 +96,13 @@ trap 'rm -rf "$tmp"' EXIT INT TERM
fetch_to "$base/${name}.tar.gz" "$tmp/${name}.tar.gz" \
|| die "no build published for ${target} in ${VERSION}."

if fetch_to "$base/SHA256SUMS" "$tmp/SHA256SUMS" 2>/dev/null; then
expected=$(grep " ${name}.tar.gz\$" "$tmp/SHA256SUMS" | cut -d' ' -f1 || true)
if [ -n "$expected" ] && command -v sha256sum >/dev/null 2>&1; then
actual=$(sha256sum "$tmp/${name}.tar.gz" | cut -d' ' -f1)
[ "$expected" = "$actual" ] || die "checksum mismatch for ${name}.tar.gz — refusing to install."
ok "checksum verified"
else
say "skipping checksum verification (no entry or no sha256sum)"
fi
fi
fetch_to "$base/SHA256SUMS" "$tmp/SHA256SUMS" 2>/dev/null \
|| die "could not download SHA256SUMS — refusing an unverified install."
expected=$(grep " ${name}.tar.gz\$" "$tmp/SHA256SUMS" | cut -d' ' -f1 || true)
[ -n "$expected" ] || die "SHA256SUMS has no entry for ${name}.tar.gz."
actual=$(sha256sum "$tmp/${name}.tar.gz" | cut -d' ' -f1)
[ "$expected" = "$actual" ] || die "checksum mismatch for ${name}.tar.gz — refusing to install."
ok "checksum verified"

tar -xzf "$tmp/${name}.tar.gz" -C "$tmp"
[ -x "$tmp/$name/ratfetch" ] || die "the archive did not contain a ratfetch binary."
Expand Down
4 changes: 2 additions & 2 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h1>rat<span>fetch</span></h1>
<h2>What it does</h2>
<ul>
<li><b>Live, not a snapshot.</b> Everything re-reads on a configurable interval.</li>
<li><b>526 logos</b>, vendored from fastfetch with their original colour palettes.</li>
<li><b>527 logos</b>, vendored from fastfetch with their original colour palettes.</li>
<li><b>Four tabs</b> — overview, processes, filesystems, interfaces.</li>
<li><b>13 themes</b>, plus per-role colour overrides.</li>
<li><b>No <code>sysinfo</code> crate.</b> <code>/proc</code> and <code>/sys</code> are read directly.</li>
Expand All @@ -91,7 +91,7 @@ <h2>What it does</h2>

<h2>Other ways to install</h2>
<pre># a specific version, or a different directory
RATFETCH_VERSION=v0.1.0 sh -c "$(curl -fsSL https://tuna4ll.github.io/ratfetch/install.sh)"
RATFETCH_VERSION=v0.2.0 sh -c "$(curl -fsSL https://tuna4ll.github.io/ratfetch/install.sh)"
RATFETCH_INSTALL_DIR=~/bin sh -c "$(curl -fsSL https://tuna4ll.github.io/ratfetch/install.sh)"

# manual setup, from source — needs Rust 1.88+
Expand Down
Loading
Loading