Implement fastfetch information in the terminal easily

How to implement fastfetch information in the terminal at each startup is a fairly simple procedure. Since they helped me implement an info that usually isn’t there, I’m opening this thread for the procedure, and I’ll also add the two additions that I used (to not use them, just don’t add the scripts).

Obviously, this kind of guide is aimed more at novices like me, but in the end it can be open to everyone.

I’ll make a step-by-step “guide”.

So, let’s start by saying that in addition to the terminal, we need fastfetch installed on the system. So, to install fastfetch just give this command in the terminal:

sudo pacman -S fastfetch

Fastfetch also has optional dependencies that can be installed, they are additional modules of various kinds, from more in-depth hardware detection or various other hardware to the output logos.

Then I’ll tell you what they are, for now it’s fine like this.

Anyway, once fastfetch is installed you need to make it generate a configuration file, with the following command from the terminal:

fastfetch --gen-config

To be able to edit what fastfetch shows in the terminal, and therefore edit the configuration file created, at this point you need to use the command from the terminal:

nano ~/.config/fastfetch/config.jsonc

In the terminal you will see the configuration file opened with “nano”, a text editor, and where you can go to modify, remove or add options, then save and exit.

So, once in the screen, use the // symbols to remove the items that you do not want to show, for example:

// “terminal”,

After that you can save with CNTRL+O and exit with CNTRL+X.

Once this is done, to add the execution of fastfetch with the terminal, type the command:

nano ~/.bashrc

And in the screen add the following to the last line:

fastfetch

After that you can save and exit (always with CNTRL+O to save and CNTRL+X to exit), and at the next restart of the terminal you will have the console with the fastfetch info shown in the terminal.

Thanks to SynAck for helping me put the weather info of my city, which you can find here:

The optional dependencies of fastfetch are: chafa, dbus, dconf, ddcutil, directx-headers, glib2, hwdata, imagemagick, libdrm, libelf, libpulse, libxrandr, ocl-icd, sqlite, vulkan-icd-loader, xfconf, zlib. To install them, just give the command:

sudo pacman -S chafa dbus dconf ddcutil directx-headers glib2 hwdata imagemagick libdrm libelf libpulse libxrandr ocl-icd sqlite vulkan-icd-loader xfconf zlib

That’s if you want to install them all. If you’re only interested in some optional dependencies, just put those.

But what are these optional dependencies for? Here’s what they do:

Description of dependencies

chafa : Image output as ascii art
dbus : Bluetooth, Player & Media detection
dconf : Needed for values that are only stored in DConf + Fallback for GSettings
ddcutil : Brightness detection of external displays
directx-headers : GPU detection in WSL
glib2 : Output for values that are only stored in GSettings
hwdata : GPU output
imagemagick : Image output using sixel or kitty graphics protocol
libdrm : Displays detection
libelf : st term font detection and fast path of systemd version detection
libpulse : Sound detection
libxrandr : Multi monitor support
ocl-icd : OpenCL module
sqlite : Needed for Sqlite integration and Soar packages count
vulkan-icd-loader : Vulkan module & fallback for GPU output
xfconf : Needed for XFWM theme and XFCE Terminal font
zlib : Faster image output when using kitty graphics protocol

And if you also want to know how long your operating system has been installed, you can add the script that I will indicate below, to have this information (there is no module age of the os, so you need to add a script).

script OS Age

The script is this:

the first way
{
        "type": "command",
        "key": "OS Age",
        "text": "birth_install=$(stat -c %W /); current=$(date +%s); time_progression=$((current - birth_install)); days_difference=$((time_progression / 86400)); echo $days_difference days",
        "keyColor": "magenta"
 },

And the result in the fastfetch configuration file will be something like this:

{
  "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
  "modules": [
    "title",
    "separator",
    "os",
    "host",
    "kernel",
    "uptime",
    {
        "type": "command",
        "key": "OS Age",
        "text": "birth_install=$(stat -c %W /); current=$(date +%s); time_progression=$((current - birth_install)); days_difference=$((time_progression / 86400)); echo $days_difference days",
        "keyColor": "magenta"
    },
    "packages",
    "shell",

You can use the one inside the “spoiler” above, or the one suggested by SynAck, which does the exact same thing but is shorter:

OS Age script by SynAck
 {
        "type": "command",
        "key": "OS Age",
        "text": "echo $(( ($(date +%s) - $(stat -c %W /)) / 86400 )) days",
        "keyColor": "magenta"
    },

And the resulting, in the fastfetch configuration file will be like this:

  GNU nano 8.4                                                                   /home/sermor/.config/fastfetch/config.jsonc                                                                                
{
  "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
  "modules": [
    "title",
    "separator",
    "os",
    "host",
    "kernel",
    "uptime",
    {
        "type": "command",
        "key": "OS Age",
        "text": "echo $(( ($(date +%s) - $(stat -c %W /)) / 86400 )) days",
        "keyColor": "magenta"
    },
    "packages",
    "shell",
    "display",

Well, that’s all, I hope this can be helpful to you!

3 Likes

Do not use sudo when unnecessary.
Furthermore using something like sudo on paths like $HOME can break their permissions.
As these are paths in $HOME modifications can be made using any editor and any escalation should be avoided.

2 Likes

If, like @cscs & I, you like short bash script, a more concise “OS Age” calculation could be:
echo $(( ($(date +%s) - $(stat -c %W /)) / 86400 )) days

Fastfetch output:
OS Age: 258 days

COMMAND INTERPRETER - simply the funnest game in town.

1 Like

I’ve written some more wttr script for fastfetch (& more), hopefully you find it useful:
Automated wttr.in weather data caching & reuse

1 Like

Open post edited with additions and corrections. Thanks guys!

nice tutorial, thank you!

I’m still prefer inxi -CDGmrS --verbosity 1 but it’s nowhere near as pretty as fastfetch

1 Like

People are different (fortunately). I enjoy watching what others do and how they “pimp” their systems (thanks for sharing!), but usually that’s not for me:

I typically take what’s default in a DE, and expect a “naked” prompt in a terminal—just because I want to get some work done, and not be flashed by lots of info that distracts. (Same with writing: I typically use Ghostwriter for distraction-free writing.)

If I want info, I use inxi or one of the many other tools. I’ve always avoided getting used to my personal tweaks too much, because I have to work on many systems owned and set up by others, and you often simply won’t find “your” tools & tweaks on such machines.

I agree that fastfetch and things like Conky can be super-pretty, but to me that’s more like “showing off”, and would distract me (and eat resources). Kinda like “Linux as a purpose in itself” (which, of course, can be a vaild reason). If you’re ssh’ing into a lot of systems, a quick info is probably nice to have.

It’s all about use cases. But maybe I’m just old, and easily distracted. I also often digress. :rofl:

1 Like

Finding the right balance between useful & efficient & pleasing.

Sometimes all you need are ssh, screen, & maybe tmux :+1:

1 Like

I don’t use Conky, but I’ve used Fastfecth for a long time. While it can be kind of a “show off” thing, it can also be configured with useful info. I do both, as mine is possibly a bit of a show of, but it’s also set with a bit of useful info. I also have fastfetch set to show upon launching Kitty…

  • Click to enlarge: