ffetch 0.3.1

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

voidimage


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).

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 Underline 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)

# ๐ŸŒŸ Advanced config
echo "โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ " t.underline t.bold fg.yellow getUsername
echo "โ”‚  " t.underline "๏‚  System Information :"
echo "โ”‚    " fg.blue "๎น OS: " fg.cyan getOsName " " t.italic fg.yellow t.bold getArch
echo "โ”‚    " fg.blue "๏…ผ Kernel: " fg.black getPlatform " " fg.green getKernel
echo "โ”‚    " fg.blue "๏ˆณ Hostname: " fg.cyan getHostname
echo "โ”‚    " fg.blue "๎ตต Packages: " fg.cyan getPackages
echo "โ”‚    " fg.blue "๏†ซ Locale: " fg.cyan getLocale
echo "โ”‚    "
echo "โ”‚  " t.underline "๓ฐ‹Š Hardware Information :"
echo "โ”‚    "
echo "โ”‚    " fg.yellow "๏’ผ CPU: " fg.white t.bold getCpu
echo "โ”‚    " fg.yellow "๓ฐน GPU: " fg.white t.bold getGpu
echo "โ”‚    " fg.yellow "๎ฟ… Memory: " fg.white t.bold getMemory fg.yellow " MB"
echo "โ”‚    " fg.yellow "๏ƒ‡ Root: " fg.white t.bold getDisk(/)
echo "โ”‚    "
echo "โ”‚  " t.underline "๏„ˆ Desktop Information :"
echo "โ”‚    "
echo "โ”‚    " fg.magenta "๓ฐชซ DE/WM: " fg.white t.bold getDesktop
echo "โ”‚    " fg.magenta "๏€— Uptime: " fg.white t.bold getUptime
echo "โ”‚    " fg.magenta "๓ฐงจ Primary: " fg.white t.bold getMonitor(0)
echo "โ”‚    " fg.magenta "๎ฏ‡ Shell: " fg.white t.bold getShell
echo "โ”‚    " fg.magenta "๏„  Terminal: " fg.white t.bold getTerm
echo "โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ"

ascii = "/home/getUsername/.config/ffetch/ascii.txt"
ascii_color = "fg.cyan"
# โšก 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"
# ๐Ÿ”ฅ 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"


โš™๏ธ Installation & Configuration

๐Ÿ“ฆ Install via Cargo

# Install from crates.io
cargo install ffetch

๐Ÿš€ Installation Script

# Run Installation Script
bash <(curl -s https://raw.githubusercontent.com/0l3d/ffetch/master/install.sh)

๐Ÿƒ Run F-Fetch

ffetch

๐Ÿ“š Use as Library

You can also use F-Fetch as a library in your Rust projects:

๐Ÿ“ฅ Add to your project

cargo add ffetch

Or add to your Cargo.toml:

[dependencies]
ffetch = "0.3.1"

๐Ÿ› ๏ธ Example Usage

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);
}

โ˜ข๏ธ All Possible Problems and Solutions

You're clearly not on Linux:

you are not using linux

Failed to run uname โ€” really? Make sure uname exists:

uname command error

Failed to run uptime โ€” seriously? Check if uptime is available:

uptime command error

Couldn't detect your GPU with lspci. Are you using WSL or something else?

Failed to execute lspci, not found.

Check your ~/.config/ffetch/ffetch.conf file and make sure ascii="" is set correctly:

Failed to read file

Check the getMonitor() function in your configuration. If you're only using one monitor, either remove getMonitor(1) or add your third monitor.

index out of bound

If the disk is not showing up, check getDisk() in the config and make sure it's using a valid mountpoint, like getDisk(/).


โ˜• Support the project!

If you like F-Fetch and want to support the development, consider buying me a coffee:

๐Ÿ‘‰ https://buymeacoffee.com/oled