ffetch 0.5.7

Fast, minimal & Rust-powered system fetcher
Documentation
# ๐Ÿš€ **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.

---

| โš™๏ธ **Features**      | ๐Ÿ“œ **Description**                                               |
| -------------------- | ---------------------------------------------------------------- |
| ๐Ÿฆ€ **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)

| Placeholder  | ANSI Code  | Color | Description  |
| ------------ | ---------- | ----- | ------------ |
| `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

| Placeholder         | ANSI Code  | Color | Description              |
| ------------------- | ---------- | ----- | ------------------------ |
| `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

| Placeholder  | ANSI Code  | Color | Description        |
| ------------ | ---------- | ----- | ------------------ |
| `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

| Placeholder         | ANSI Code   | Color | Description                    |
| ------------------- | ----------- | ----- | ------------------------------ |
| `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

| Placeholder       | ANSI Code  | Style            | Description                |
| ----------------- | ---------- | ---------------- | -------------------------- |
| `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

| Placeholder | ANSI Code | Function | Description          |
| ----------- | --------- | -------- | -------------------- |
| `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)