/rustfetch

A modern and highly customizable system information tool that is similar to neofetch.

Primary LanguageRust

Rustfetch

Rustfetch is a modern and highly customizable system information tool built in the Rust programming language similar to tools like Neofetch. It is highly modular and uses the Lua scripting language for custom modules. It also has support for custom ASCII art, custom color themes, etc... It still works out of the box if you don't want to configure anything.

NOTE: Rustfetch is still under development.

Prerequisites

  • A 64 bit Linux system. (No current support for MacOS/Windows)

VERY IMPORTANT: Rustfetch relies on /proc/ files. These are files generated by your kernel. To assure that Rustfetch performs correctly, make sure you have a new(ish) Linux kernel version as older kernel versions can sometimes have different outputs.

  • An x86_64 CPU. (No current support for ARM or 32 bit systems)

  • Git

Installation

Stable release

The latest stable release is placed in the download/ directory.

First, click on the download directory. You should see a rustfetch executable. Download that.

It is recommended to place rustfetch binaries in a separate directory. Here's an example:

mkdir .rustfetch
mv ~/Downloads/rustfetch .rustfetch

Replace ~/Downloads/rustfetch with the actual binary's path that you downloaded.

Adding rustfetch to your PATH

To add Rustfetch, add this line to the bottom of your ~/.bashrc file:

export PATH="$PATH:$HOME/.rustfetch"

If you placed the Rustfetch binary elsewhere, replace $HOME/rustfetch with the path you picked.

Make sure everything worked

Try running this:

rustfetch version --verbose

You should get an output SIMILAR to this:

Rustfetch: A modern and highly customizable system information tool.
GitHub Repo: https://github.com/xshotss/rustfetch
v0.1.0

Post-install

Even after installing Rustfetch to your PATH, Rustfetch is still unusable. You need to run this handy command to configure everything.

rustfetch gen-config

Troubleshooting If you get something like a "Permission denied" error, try running this:

chmod +x ~/.rustfetch/rustfetch

You only need to run this command once. This command adds a directory to your ~/.config/ directory called rustfetch. You can do this to make sure it worked:

cd ~/.config/rustfetch
ls

This should contain the Rustfetch structure. Now you can run Rustfetch and you should get the default Rustfetch output!

rustfetch

Building from source (Nightly build)

If you want the absolute latest features, you can compile Rustfetch yourself.

NOTE: This way of using Rustfetch is not supported and is very likely to be unstable. Don't do this if you don't know what you're doing.

You also need the full Rust compiler (cargo, rustc, etc...). Make sure you meet the default requirements too.

FIrst, clone the Git repository and go into it:

cd ~
git clone https://github.com/xshotss/rustfetch.git
cd rustfetch

Now, you will need to build it. This can take a while.

cargo build --release --verbose

Now the binary will be located at rustfetch/target/release/rustfetch. To add the release to your PATH, add this to the bottom of your ~/.bashrc file:

export PATH="$PATH:$HOME/rustfetch/target/release"

Make sure that Rustfetch is located at ~/rustfetch

Post-install

Even after installing Rustfetch to your PATH, Rustfetch is still unusable. You need to run this handy command to configure everything.

rustfetch gen-config

Troubleshooting If you get something like a "Permission denied" error, try running this:

chmod +x ~/rustfetch/target/release/rustfetch

You only need to run this command once. This command adds a directory to your ~/.config/ directory called rustfetch. You can do this to make sure it worked:

cd ~/.config/rustfetch
ls

This should contain the Rustfetch structure. Now you can run Rustfetch and you should get the default Rustfetch output!

rustfetch

Configuration and scripting

NOTE: Some basic knowledge of Lua is required.

Rustfetch uses a highly configured Lua environment for scripting. The only Lua config file that is available is ~/.config/rustfetch/config.lua. The limits of Rustfetch are basically just Lua's limitations.

NOTE: Rustfetch is still under development. Only builtin modules are currently allowed.

To configure Rustfetch, go to your ~/.config/rustfetch/config.lua file. This is the default Lua configuration:

-- This is an automatically generated config file for Rustfetch.
-- Check the Github repo for help:
-- https://github.com/xshotss/rustfetch

-- All ASCII art files should be placed in ~/.config/rustfetch/ascii/
ascii = "tux.txt"

mode = "fancy"

show_ascii = true

modules = {
  CPU = {
    type = "builtin"
  },
  GPU = {
    type = "builtin"
  },
  Host = {
    type = "builtin"
  },
  Memory = {
    type = "builtin"
  }
}

Custom ASCII

To add custom ASCII to Rustfetch, add a .txt file to your ~/.config/rustfetch/ascii directory. Then, go into your config.lua script and change the value of the ascii variable to the file's path that you just added.

Builtin Modules

Rustfetch comes with some builtin modules like GPU, CPU, etc... All the builtin modules are already turned on by default. To remove one, just remove them from the modules table.

Custom Modules

Coming soon...