Neofetch
Neofetch is a CLI utility used to display system information. It was written in Bash, and thus its configuration file is written as a Bash script too. This document was written with org-mode, and my configuration file is tangled from the source blocks you will see below to ~/.config/neofetch/config.conf
. This configuration will only contain what I need. For any further information, please refer to the original repository and its documentation.
The print_info
functions
The print_info
function is the function called by Neofetch in order to print the system information it could fetch. In this function, we’ll choose what to display, and how. This function looks like this:
print_info() {
# Print information here…
}
Generally, what we will display will be shown through the info
function, redefined inside Neofetch (this is not info(1)
). This info
function accepts one or two arguments. With one argument, such as with info memory
, we can get a result that looks like 5136MiB / 15873MiB
, while calling it with two arguments will treat the first one as a prefix and the second one as the interesting information; info "Memory" memory
will look like Memory: 5136MiB / 15873MiB
. Here is what we want to display:
Prefix | Information | What it does |
---|---|---|
title | Username and hostname | |
line_break | Insert a blank line | |
cols | System theme | |
line_break | Insert a blank line | |
Distro | distro | Distribution name |
Kernel | kernel | Kernel version |
Uptime | uptime | Machine uptime |
Packages | packages | Number of installed packages |
Shell | shell | User’s default shell |
WM | wm | User’s Window Manager |
Terminal | term | Default terminal |
CPU | cpu | CPU information |
GPU | gpu | GPU information |
Memory | memory | RAM information |
Hence, the function looks like so:
print_info() {
info title
info line_break
info cols
info line_break
info "Distro" distro
info "Kernel" kernel
info "Uptime" uptime
info "Packages" packages
info "Shell" shell
info "WM" wm
info "Terminal" term
info "CPU" cpu
info "GPU" gpu
info "Memory" memory
}
Each of these modules can be tuned with the variables presented below.
Information settings
Each of the following variable tunes a function that can be called in print_info
described above. It is possible to tune them by modifying this document or the configuration file itself, and they can be overridden by the command line with flags passed to neofetch
. I will divide these variables in two main categories: hardware and software-related properties.
Software
OS
Distro
This variable can shorten the output of the
distro
function.- Default value:
"on"
- Values: -
"on"
"off"
- Flag:
--distro_shorthand
- Supports: Everything except Windows and Haiku
- Examples: - on:
Arch Linux
- off:
Arch
- off:
distro_shorthand="off"
It is possible to display when the distro has been installed on the computer.
Distro art or image
By default, Neofetch will display ASCII art next to our system information representing our distro’s logo. We’ll customize it a bit. First, let’s change the
backend
value. Note that most of them (exceptoff
of course) support shorthands such as--kitty
when passed as arguments from the command line. In my case, I will use the Kitty backend since it is the native backend of the terminal emulator I use.- Default value:
"ascii"
- Values: -
ascii
caca
catimg
chafa
jp2a
iterm2
off
pot
termpix
pixterm
tycat
w3m
kitty
ueberzug
viu
- flag:
--backend
image_backend="kitty"
Now, since I indicated I wanted an image engine, I’ll indicate Neofetch which image to find. Note that
auto
will pick the best image source for whatever image backend is used. In ASCII mode, distro ASCII art will be used and in an image mode, your wallpaper will be used.- Default value:
auto
- Values: -
auto
ascii
wallpaper
/path/to/img
/path/to/ascii
/path/to/dir/
command output (neofetch --ascii "$(fortune | cowsay -W 30)")
- Flag:
--source
image_source="$HOME/org/config/img/leon.png"
The default image size will probably not be correct since it is half the terminal width and I have an ultrawide monitor, so I’ll need to set it manually.
- Default value:
auto
- Values: -
auto
00px
00%
none
- Flag:
--image-size
or--size
image_size="224px"
- Default value:
- Default value:
Kernel
The variable below can shorten the output ofh the
kernel
function.- Default value:
"on"
- Values: -
"on"
"off"
- Flag:
--kernel_shorthand
- Supports: Everything except *BSDs (except PacBSD and PC-BSD)
- Examples: - on:
4.8.9-1-ARCH
- off:
Linux 4.8.9-1-ARCH
- off:
kernel_shorthand="off"
- Default value:
OS Architecture
This variable can show or hide the OS architecture in the
distro
output.- Default value:
"off"
- Values: -
"on"
"off"
- Flag:
--os_arch
- Examples: - on:
Arch Linux x86_64
- off:
Arch Linux
- off:
os_arch="off"
- Default value:
Packages
It is possible to show or hide Package Manager names.
- Default:
'tiny'
- Values:
'on'
/'tiny'
/'off'
- Flag:
--package_managers
- Example: - on:
'998 (pacman), 8 (flatpak), 4 (snap)'
- tiny:
'908 (pacman, flatpak, snap)'
- off:
'908'
- tiny:
package_managers="on"
- Default:
Shell
Shell path
This allows to show either the path of the user’s shell, or simply its name.
- Default value:
"off"
- Values: -
"on"
"off"
- Flag:
--shell_path
- Examples: - on:
/bin/bash
- off:
bash
- off:
shell_path="off"
- Default value:
Shell version
This allows to show the shell’s version in the output of
shell
.- Default value:
"on"
- Values: -
"on"
"off"
- Flag:
--shell_version
- Examples: - on:
bash 4.4.5
- off:
bash
- off:
shell_version="off"
- Default value:
Uptime
This variable can shorten the output of the uptime
function. on
shortens it a bit, while tiny
shortens it greatly.
- Default value:
"on"
- Values: -
"on"
"tiny"
"off"
- Flag:
--uptime_shorthand
- Examples: - on:
2 days, 10 hours, 3 mins
- off:
2 days, 10 hours, 3 minutes
- tiny:
2d 10h 3m
- off:
uptime_shorthand="on"
IP address
It is possible to display the machine’s public IP address with the function ip
. The value below allows the user to change the website used to fetch it.
- Default value:
"http://ident.me"
- Value:
"url"
- Flag:
--ip_host
public_ip_host="http://ident.me"
Theming
This section will allow the user to modify what Neofetch can and cannot display about the machine’s theming —by this, I mean its GTK theme, its icons and its default font.
Shorten output
With this value, it is possible to shorten the output of the computer’s theming.
- Default value:
"off"
- Values: -
"on"
"off"
- Flag:
--gtk_shorthand
- Examples: - on:
Numix, Adwaita
- off:
Numix [GTK2], Adwaita [GTK3]
- off:
gtk_shorthand="on"
- Default value:
Enable or disable theming display for GTK2
It is possible to explicitely show or hide the computer’s theming with GTK2 with this variable.
- Default value:
"on"
- Values: -
"on"
"off"
- Flag:
--gtk2
- Examples: - on:
Numix [GTK2], Adwaita [GTK3]
- off:
Adwaita [GTK3]
- off:
gtk2="off"
- Default value:
Enable or disable theming display for GTK3
The same variable as above is also available for GTK3.
- Default value:
"on"
- Values: -
"on"
"off"
- Flag:
--gtk3
- Examples: - on:
Numix [GTK2], Adwaita [GTK3]
- off:
Numix [GTK2]
- off:
gtk3="off"
- Default value:
Hardware
CPU
CPU brand
With these variables, it is possible to show or hide the brand of a CPU in the
cpu
output.- Default value:
"on"
- Values: -
"on"
"off"
- Flag:
--cpu_brand
- Examples: - on:
Intel i7-6500U
- off:
i7-6500U
- off:
cpu_brand="off"
- Default value:
CPU speed
With this variable, it is possible to show or hide the speed of the CPU.
- Default value:
"on"
- Values: -
"on"
"off"
- Flag:
--cpu_speed
- Examples: - on:
Intel i7-6500U (4) @ 3.1GHz
- off:
Intel i7-6500U (4)
- off:
cpu_speed="off"
- Default value:
CPU speed type
This allows Neofetch to know what type of speed it has to fetch regarding the machine’s CPU. Any file in
/sys/devices/system/cpu/cpu0/cpufreq
can be used as a value.- Default value:
"bios_limit"
- Values: -
"scaling_cur_freq"
"scaling_min_freq"
"scaling_max_freq"
"bios_limit"
- Flag:
--speed_type
- Supports: Linux with
cpufreq
speed_type="bios_limit"
- Default value:
CPU speed shorthand
This value allows showing sorter CPU speed with fewer digits. This flag is not supported in systems with CPU speed below 1GHz.
- Default value:
"off"
- Values: -
"on"
"on"
- Flag:
--speed_shorthand
- Examples: - on:
i7-6500U (4) @ 3.1GHz
- off:
i7-6500U (4) @ 3.100GHz
- off:
speed_shorthand="on"
- Default value:
CPU cores
With this variable, it is possible to display the number of cores that are available in the CPU.
- Default value:
"logical"
- Values: -
"logical"
"physical"
"off"
- Flag:
--cpu_cores
- Supports:
physical
does not work on BSD. - Examples: - logical:
Intel i7-6500U (4) @ 3.1GHz
(All virtual cores)- physical:
Intel i7-6500U (2) @ 3.1GHz
(All physical cores) - off:
Intel i7-6500U @ 3.1GHz
- physical:
cpu_cores="off"
- Default value:
CPU temperature
This variable allows the user to hide or show the CPU’s temperature, and if shown, the user can display it in Celsius or Fahrenheit degrees. For FreeBSD and NetBSD-based systems, you’ll need to enable the
coretemp
kernel module. This only supports newer Intel processors.- Default value:
"off"
- Values: -
"C"
"F"
"off"
- Flag:
--cpu_temp
- Supports: Linux, BSD
- Examples: - C:
Intel i7-6500U (4) @ 3.1GHz [27.2°C]
- F:
Intel i7-6500U (4) @ 3.1GHz [82.0°F]
- off:
Intel i7-6500U (4) @ 3.1GHz
- F:
cpu_temp="off"
- Default value:
GPU
The function responsible for displaying information regarding the GPUs is gpu
. It will try to list all available GPUs and display what it knows about them.
GPU brand
This value allows the user to hide or show the brand of their GPU in the output of
gpu
.Default value:
"on"
Values: -
"on"
"off"
Flag:
--gpu_brand
Supports:
Examples: - on:
AMD HD 7950
- off:
HD 7950
- off:
gpu_brand="off"
Which GPU to display
This allows the user to choose which GPU appears in the output of the function
gpu
.Default value:
"all"
Values: -
"all"
"dedicated"
"integrated"
Flag:
--gpu_type
Supports: Linux
Examples: - all:
- dedicated:
GPU1: AMD HD 7950
- integrated:
GPU1: Intel Integrated Graphics
- dedicated:
gpu_type="all"
Resolution
This will try to list all the connected screens and display their resolution individually. It is possible to display the refresh rate or to hide it.
- Default value:
"off"
- Values: -
"on"
"off"
- Flag:
--refresh_rate
- Supports: Does not work on Windows
- Examples: - on:
1920x1080 @ 60Hz
- off:
1920x1080
- off:
refresh_rate="off"