# ๐ **F-Fetch:** _Fast, Minimal & Rust-Powered System Fetcher_
F-Fetch is a **very fast**, **minimal** terminal system fetcher written **100% in Rust**.
It is **highly customizable** - allowing you to add your own syntax and integrate your own features.
At its core, it works simply and the codebase is easy to understand.
---
| ๐ฆ **Rust** | Written 100% in Rust |
| ๐จ **Flexibility** | Highly flexible - customize the appearance as you wish |
| โก **Efficiency** | Despite flexibility, uses very little space and system resources |
| ๐ง **Customization** | Offers a wide range of customization options |
---
<img width="1100" height="608" alt="image" src="https://github.com/user-attachments/assets/23fcc419-4c0b-4e3e-aeda-b557b45cb690" />
---
# โ๏ธ **Installation & Configuration**
## ๐ฆ **Install via Cargo**
```bash
# Install from crates.io
cargo install ffetch
```
## ๐ **Installation Script**
```bash
# Run Installation Script
bash <(curl -s https://raw.githubusercontent.com/0l3d/ffetch/master/install.sh)
```
## ๐ **Run F-Fetch**
```bash
ffetch
```
---
# ๐ **Use as Library**
You can also use F-Fetch as a library in your Rust projects:
## ๐ฅ **Add to your project**
```bash
cargo add ffetch
```
Or add to your `Cargo.toml`:
```toml
[dependencies]
ffetch = "0.5.5"
```
## ๐ ๏ธ **Example Usage**
```rust
use ffetch::*;
fn main() {
// Get system information
let username = get_username();
let os_name = get_os_name();
let cpu_info = get_cpu();
let memory = get_memory();
println!("User: {}", username);
println!("OS: {}", os_name);
println!("CPU: {}", cpu_info);
println!("Memory: {} MB", memory);
}
```
---
## Dependencies
If u're using `getTerm`, u need to make sure xprop is installed.
If `getMonitor` fails, it uses `xrandr`.
For GPU and disk information, I use standard Linux tools like lspci (from pciutils) and df (from coreutils).
# F-Fetch Configuration & Examples
## F-Fetch Components List
- `getUsername`
Returns the current **Username**.
- `getKernel`
Returns the **Kernel Version**.
- `getCpu`
Returns **CPU Information**.
- `getMemory`
Returns **Memory Usage**.
- `getHostname`
Returns the system **Hostname**.
- `getOsName`
Returns the **Operating System Name**.
- `getDesktop`
Returns the **Desktop Environment** or Window Manager.
- `getArch`
Returns the system **Architecture** (e.g., x86_64).
- `getPlatform`
Returns the system **Platform** information.
- `getUptime`
Returns the system **Uptime**.
- `getTerm`
Returns the current **Terminal Emulator**.
- `getGpu`
Returns the primary **GPU Information**.
- `getMGpu`
Returns the secondary **GPU Information** (if any).
- `getShell`
Returns the current **Shell**.
- `getDisk(mountpoint)`
Returns the **Disk Usage** information for the specified mount point.
- `getMonitor(monitorindex)`
Returns the **Monitor** information for the specified monitor index.
- `getPackages` (emerge, flatpak, apt, dnf, yum, pacman, zypper, nix-env, xbps-query)
Returns the **number of installed packages**.
- `getLocale`
Returns your system **locale** (e.g., `en_US`).
- `getTerm`
Returns your **terminal emulator**.
- `getBackend`
Returns your **windowing system**.
- `getInit`
Returns your system **init** (e.g, `runit-init`).
- `getQT` or `getGTK`
Returns your theme from environment variables.
- `getBoardVendor`, `getBoardName` and `getBoardVersion`
Returns your system motherboard informations. (e.g, MSI)
## F-Fetch Style ANSI Color Codes Reference
### ๐จ Foreground Colors (Text Colors)
| `fg.black` | `\x1b[30m` | โซ | Black text |
| `fg.red` | `\x1b[31m` | ๐ด | Red text |
| `fg.green` | `\x1b[32m` | ๐ข | Green text |
| `fg.yellow` | `\x1b[33m` | ๐ก | Yellow text |
| `fg.blue` | `\x1b[34m` | ๐ต | Blue text |
| `fg.magenta` | `\x1b[35m` | ๐ฃ | Magenta text |
| `fg.cyan` | `\x1b[36m` | ๐ต | Cyan text |
| `fg.white` | `\x1b[37m` | โช | White text |
### โจ Bright Foreground Colors
| `fg.bright_black` | `\x1b[90m` | โซ | Bright black (gray) text |
| `fg.bright_red` | `\x1b[91m` | ๐ด | Bright red text |
| `fg.bright_green` | `\x1b[92m` | ๐ข | Bright green text |
| `fg.bright_yellow` | `\x1b[93m` | ๐ก | Bright yellow text |
| `fg.bright_blue` | `\x1b[94m` | ๐ต | Bright blue text |
| `fg.bright_magenta` | `\x1b[95m` | ๐ฃ | Bright magenta text |
| `fg.bright_cyan` | `\x1b[96m` | ๐ต | Bright cyan text |
| `fg.bright_white` | `\x1b[97m` | โช | Bright white text |
### ๐ญ Background Colors
| `bg.black` | `\x1b[40m` | โซ | Black background |
| `bg.red` | `\x1b[41m` | ๐ด | Red background |
| `bg.green` | `\x1b[42m` | ๐ข | Green background |
| `bg.yellow` | `\x1b[43m` | ๐ก | Yellow background |
| `bg.blue` | `\x1b[44m` | ๐ต | Blue background |
| `bg.magenta` | `\x1b[45m` | ๐ฃ | Magenta background |
| `bg.cyan` | `\x1b[46m` | ๐ต | Cyan background |
| `bg.white` | `\x1b[47m` | โช | White background |
### ๐ Bright Background Colors
| `bg.bright_black` | `\x1b[100m` | โซ | Bright black (gray) background |
| `bg.bright_red` | `\x1b[101m` | ๐ด | Bright red background |
| `bg.bright_green` | `\x1b[102m` | ๐ข | Bright green background |
| `bg.bright_yellow` | `\x1b[103m` | ๐ก | Bright yellow background |
| `bg.bright_blue` | `\x1b[104m` | ๐ต | Bright blue background |
| `bg.bright_magenta` | `\x1b[105m` | ๐ฃ | Bright magenta background |
| `bg.bright_cyan` | `\x1b[106m` | ๐ต | Bright cyan background |
| `bg.bright_white` | `\x1b[107m` | โช | Bright white background |
### ๐ Text Styles
| `t.bold` | `\x1b[1m` | **Bold** | Make text bold |
| `t.dim` | `\x1b[2m` | Dim | Make text dimmed |
| `t.italic` | `\x1b[3m` | _Italic_ | Make text italic |
| `t.underline` | `\x1b[4m` | <u>Underline</u> | Underline text |
| `t.inverse` | `\x1b[7m` | Inverse | Swap foreground/background |
| `t.hidden` | `\x1b[8m` | Hidden | Hide text |
| `t.strike` | `\x1b[9m` | ~~Strike~~ | Strike through text |
| `t.bold_off` | `\x1b[21m` | Normal | Turn off bold |
| `t.underline_off` | `\x1b[24m` | Normal | Turn off underline |
| `t.inverse_off` | `\x1b[27m` | Normal | Turn off inverse |
### ๐ Reset
| `all.reset` | `\x1b[0m` | Reset | Reset all formatting |
---
## ๐ ๏ธ **F-Fetch Configuration Examples**
### (Advanced, Middle, Minimal)
```bash
# ๐ Advanced config
echo "โญโโโโโโโโโโโโโ " t.underline t.bold fg.yellow getUsername all.reset " โโโโโโโโโโโโโโโโโโโโโโโโโโฎ"
echo "โ " t.underline fg.bright_red "๏ System Information :"
echo "โ " fg.white t.bold "๎น OS: " all.reset fg.green getOsName " " t.italic fg.yellow t.bold getArch
echo "โ " fg.white t.bold "๓ฐ
Host: " all.reset fg.green getBoardName " " (getBoardVersion)
echo "โ " fg.white t.bold "๏
ผ Kernel: " all.reset fg.green getKernel
echo "โ " fg.white t.bold "๏ณ Hostname: " all.reset fg.green getHostname
echo "โ " fg.white t.bold "๎ตต Packages: " all.reset fg.green getPackages
echo "โ " fg.white t.bold "๏ซ Locale: " all.reset fg.green getLocale
echo "โ " fg.white t.bold "๎ฝฌ Init: " all.reset fg.green getInit
echo "โ "
echo "โ " t.underline fg.bright_green "๓ฐ Hardware Information :"
echo "โ "
echo "โ " fg.yellow t.bold "๏ผ CPU: " all.reset fg.white getCpu
echo "โ " fg.yellow t.bold "๓ฐน GPU: " all.reset fg.white getGpu
echo "โ " fg.yellow t.bold "๎ฟ
Memory: " all.reset fg.white getMemory fg.yellow " MB"
echo "โ " fg.yellow t.bold "๏ Root: " all.reset fg.white getDisk(/)
echo "โ "
echo "โ " t.underline fg.bright_blue "๏ Desktop Information :"
echo "โ "
echo "โ " fg.magenta t.bold "๓ฐชซ DE/WM: " all.reset fg.white getDesktop " " (getBackend)
echo "โ " fg.magenta t.bold "๏ Uptime: " all.reset fg.white getUptime
echo "โ " fg.magenta t.bold "๓ฐงจ Primary: " all.reset fg.white getMonitor(0)
echo "โ " fg.magenta t.bold "๎ฏ Shell: " all.reset fg.white getShell
echo "โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ"
ascii = "/home/getUsername/.config/ffetch/ascii.txt"
ascii_color = "fg.green"
```
```bash
# โก Middle config
echo t.bold fg.yellow getUsername fg.black "@" fg.yellow getHostname
echo fg.blue "Distro: " fg.yellow t.bold getOsName
echo fg.blue "Platform: " fg.yellow t.bold getPlatform
echo fg.blue "Kernel: " fg.yellow t.bold getKernel
echo fg.blue "Memory: " fg.yellow t.bold getMemory " MB"
echo fg.blue "CPU: " fg.yellow t.bold getCpu
echo fg.blue "GPU: " fg.yellow t.bold getGpu
echo fg.blue "Packages: " fg.yellow t.bold getPackages
echo fg.blue "Disk: " fg.yellow t.bold getDisk(/)
echo fg.blue "Desktop: " fg.yellow t.bold getDesktop
echo fg.blue "Primary: " fg.yellow t.bold getMonitor(0)
echo fg.blue "Uptime: " fg.yellow t.bold getUptime
echo fg.blue "Terminal: " fg.yellow t.bold getTerm
echo fg.blue "Shell: " fg.yellow t.bold getShell
ascii = "/home/getUsername/.config/ffetch/ascii.txt"
ascii_color = "fg.cyan"
```
```bash
# ๐ฅ Minimal config
echo getUsername "@" getHostname
echo "Distro: " getOsName
echo "Platform: " getPlatform
echo "Kernel: " getKernel
echo "Memory: " getMemory " MB"
echo "CPU: " getCpu
echo "GPU: " getGpu
echo "Packages: " getPackages
echo "Disk: " getDisk(/)
echo "Desktop: " getDesktop
echo "Primary: " getMonitor(0)
echo "Terminal: " getTerm
echo "Uptime: " getUptime
echo "Shell: " getShell
ascii = "/home/getUsername/.config/ffetch/ascii.txt"
ascii_color = "fg.cyan"
```
---
## โ Support the project
If you like F-Fetch and want to support the development, consider buying me a coffee:
๐ [https://buymeacoffee.com/oled](https://buymeacoffee.com/oled)