Pfetch is a simple command line tool to display system information in a simple way. Written in POSIX script making it able to run on many Systems.
In this article, you will learn how to install and customize pfetch on Ubuntu, so by the end of this article you should be able to use pfetch to display your system information conveniently.
Pfetch Overview
Pfetch is a command line tool to display system information in a simple and visually appealing way.
Developed by Dylan Araps, the same developer who created Neofetch, pfetch offers more simplicity and is lightweight compared to Neofetch.
It can display various system information such as OS, distro, hostname, kernel version, uptime, memory usage, and many other information. It then formats and displays this information in a concise and aesthetic way, usually using the ASCII graphic alongside the system details.
Like any other fetch tool, pfetch can display ASCII art depending on the operating system you use. For example, if you are using Ubuntu, it will display the Ubuntu logo in ASCII art style, and similarly, if you are using Arch Linux, the Arch logo will be displayed.
OS Support
Pfetch does support many operating systems and Distros, which is good because you can use and fetch system information on many different systems.
Some of the supported Operating systems are:
- Linux
- Windows
- MacOS
- FreeBSD
- Android
Pfetch also supports various Linux distros such as Ubuntu, Arch Linux, Fedora, Linux Mint, Pop!_OS, Gentoo, Alpine Linux, Void Linux, and many other Linux distros.
Install Pfetch on Ubuntu
Pfetch is not available in the Ubuntu package repositories so we need to install it from the source. In this case, we will use the git
command to get the pfetch binary file.
First, you will need to clone the pfetch repository by executing the following command:
cd /tmp
git clone https://github.com/dylanaraps/pfetch.git
By running the commands above, you will navigate to the /tmp
directory and clone the pfetch repository.
The next step is installing the pfetch binary file by running the following command:
sudo install pfetch/pfetch /usr/local/bin/
This command will place the pfetch binary file into the /usr/local/bin
directory, completing the installation of pfetch on your Ubuntu machine now.
Running the Pfetch Command
Basically, to run the pfetch command, you just need to type pfetch in the terminal and hit enter.
pfetch
the result would be something like this:
_ linuxspin@myubuntu
---(_) os Ubuntu 22.04.2 LTS
_/ --- \ host Standard PC (Q35 + ICH9, 2009) pc-q35-7.1
(_) | | kernel 5.19.0-43-generic
\ --- _/ uptime 11h 23m
---(_) pkgs 1712
memory 1200M / 3922M
pretty simple right? because the main goal of pfetch is to display the system information in a simple way but still have an aesthetic look.
Although it looks pretty basic, you can give it a little customization, which is what we will do in the next section.
Pfetch Configuration
pfetch does not use a config file, instead, it uses environment variables to configure the pfetch settings.
For example, if you want to display ascii, title, os, uptime, memory usage, and terminal palette you can set the PS_INFO
variable as the following:
export PF_INFO="ascii title os uptime memory palette" &&
pfetch
However, it really a hassle to set the PF_INFO variable every time you run pfetch. Therefore, you can store the environment variables in a file like .bashrc or .zshrc depending on what shell you are using.
To check your current active shell, use the command below:
echo $SHELL
I will assume that you are using the bash shell, we will edit the .bashrc file. If you are using a different shell, adjust accordingly (e.g., for Zsh, edit the .zshrc file).
nano ~/.bashrc
Navigate to the end of the line and add the configuration:
export PF_INFO="ascii title os uptime memory palette"
save the file, restart your terminal, and try to run pfetch command again. The output should be changed to what you’ve configured.
Here are all the system information options that you can display with pfetch:
- ascii
- title
- os
- host
- kernel
- uptime
- pkgs
- memory
- shell
- editor
- wm
- de
- palette
However, I suggest you only display the necessary options so the pfetch output won’t be cluttered.
Pfetch Custom ASCII
ASCII art is a great way to display a unique shape in the terminal making it ideal for terminal-related customization. And Pfetch does support Custom ASCII, which means you can use a custom logo displayed in ASCII style.
By default, pfetch displays the logo of your current Linux distro, but you can change it to display the logo of another distro by using PF_ASCII
variable.
For example, you can set the ASCII logo to the Arch Linux logo by adding this configuration to your .bashrc file.
export PF_ASCII="arch linux"
You can set it to any other distro, such as Debian, Manjaro, Fedora, Gentoo, or any other supported distro. If the distro is supported, pfetch will display its log. However, if it is not supported, pfetch will display the generic Linux logo instead.
For example, when you set PF_ASCII="random distro"
, it will display the generic Linux logo.
Pfetch Custom Color
Pfetch also gives you the ability to customize the colors in the pfetch output, although the color options are limited to the available color palette.
You can customize the colors of three parts in the pfetch output: the label on the left, the data on the right, and the title on the top. The colors of these three parts can be customized using the variables PF_COL1
, PF_COL2
, and PF_COL3
, respectively.
Here is an example configuration for setting the colors of pfetch:
export PF_COL1="2"
export PF_COL2="4"
export PF_COL3="5"
The value used to set the color is taken from the terminal color palette, to understand more, take a look at the image below:
Adding a Separator
By default, the separator is disabled, but you can enable it by using the PF_SEP
variable. You can use any character for the separator, but I recommend using “:”.
export PF_SEP=":"
When the separator is enabled, the display will look something like this:
Combining All the Customization Options
Now that you have learned the basic customization options for pfetch, it’s time to put them together to make the pfetch looks better.
As I mentioned earlier, to make the configurations persistent, we need to add them in the .bashrc or .zshrc file, depending on your active shell.
Let’s add the configurations to the .bashrc file using the nano
editor:
nano ~/.bashrc
Scroll to the end of the file, and paste the configuration below:
export PF_INFO="ascii title os host kernel uptime pkg memory palette"
export PF_ASCII="fedora"
export PF_COL1="2"
export PF_COL2="4"
export PF_COL3="5"
export PF_SEP=":"
Save the file, and restart your terminal. With these configurations, the pfetch output will look like this:
Conclusion
Pfetch is a simple fetch tool to display your system information in a minimalist way. By following this tutorial you should be able to install pfetch on Ubuntu and customize it as you want.