Methods of payment Abuse

Neofetch program: information about the Linux system

20.03.2021, 18:30

If you are in search of a simple, and most importantly cross-platform program for displaying information in the terminal, then pay attention to the program called Neofetch. With its help you can also set any picture. It is very similar to ScreenFetch or LinuxLogo utilities, but unlike them it is more flexible in settings, plus it contains additional functionality. The Neofetch program is very fast and displays ASCII images next to system information. It also has a tool that allows you to take a screenshot after script execution.

Main dependencies of Neofetch

We can highlight the main dependencies in this program:

  • Bash 3.0+ with Ncurses support;
  • terminal emulator must support [14t [3] or xdotool or xwininfo + xwininfo + xdpyinfo;
  • you need feh, nitrogen or gsettings to work with wallpapers.
  • w3m-img or iTerm2 to save images;
  • imagemagick to create previews.

Bash 3.0+ and [14t [3] dependencies support almost all terminals, as for all others, they are presented here as additional functionality.

How to install Neofetch in Linux

With terminal loading, information about the operating system is not just beautiful, but sometimes also useful and informative. You can install this program from any repository in any Linux distribution. Here are the installation instructions for the most popular ones.

B Debian

It is done as follows:

$ echo "deb http://dl.bintray.com/dawidd6/neofetch jessie main" | sudo tee -a /etc/apt/sources.list

$ curl -L "https://bintray.com/user/downloadSubjectPublicKey?username=bintray" -o Release-neofetch.key && sudo apt-key add Release-neofetch.key && rm Release-neofetch.key
$ sudo apt-get update
$ sudo apt-get install neofetch

In Ubuntu or Linux Mint

You need to perform:

$ sudo add-apt-repository ppa:dawidd0811/neofetch
$ sudo apt-get update
$ sudo apt-get install neofetch

In Red Hat and Fedora.

First you need to install the dnf-plugins-core plugins package:

$ sudo yum install dnf-plugins-core

Next, add a repository and install neofetch from there:

$ sudo dnf copr enable konimex/neofetch

$ sudo dnf install neofetch

In ARCHLINUX and GENTOO.

Here you can install versions of neofetch or neofetch-git from the AUR repository using packer or yaourt:

$ packer -S neofetch
$ packer -S neofetch-git

Alternatively:

$ yaourt -S neofetch

$ yaourt -S neofetch-git

For Gentoo use:

$ sudo emerge app-misc/neofetch

Working with Neofeth in Linux

For output, run just one command:

$ neofetch

Also note that if w3m-img or imagemagick is not installed on your system, screenfetch will be used by default and neofetch will display the linux logo as ASCI.

Display information about LinuxMint

Информация о Linux

Display Ubuntu information

Информация о Ubuntu

If you want to display the linux distribution logo as a plain picture, you need to install w3m-img or imagemagick on your system. In Ubuntu, run:

$ sudo apt-get install w3m-img

In Red Hat and Fedora, you need to execute:

$ sudo yum install w3m-img

Next, run the utility again, you will see the default desktop wallpaper image:

$ neofetch

Информация о Ubuntu

Once you run the program, a configuration file will be created, located at ~/.config/neofetch/config. It contains a printinfo() function that allows you to customize the system information to be output. You can delete unnecessary, add new lines, or modify them. To open the configuration file execute:

$ vi ~/.config/neofetch/config

The contents of the file will be something like this:

#!/usr/bin/env bash
# vim:fdm=marker
#
# Neofetch config file
# https://github.com/dylanaraps/neofetch
# Speed up script by not using unicode
export LC_ALL=C
export LANG=C
# Info Options {{{{{
# Info
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
printinfo() {
info title
info underline
info "Model" model
info "OS" distro
info "Kernel" kernel
info "Uptime" uptime
info "Packages" packages
info "Shell" shell
info "Resolution" resolution
info "DE" de
info "WM" wm
info "WM Theme" wmtheme
info "Theme" theme
info "Icons" icons
info "Terminal" term
info "Terminal Font" termfont
info "CPU" cpu
info "GPU" gpu
info "Memory" memory
# info "CPU Usage" cpu_usage
# info "Disk" disk
# info "Battery" battery
# info "Font" font
# info "Song" song
# info "Local IP" localip
# info "Public IP" publicip
# info "Users" users
# info "Birthday" birthday
info linebreak
info cols
info linebreak
}

To remove all customization options and settings use:

$ neofetch --help

To check if all the settings are correct we execute:

$ neofetch --test

The --ascii flag allows the user to specify that the distribution logo should be displayed in text:

$ neofetch --ascii

By adding a run line to the end of ~/.bashrc, the utility will be run every time the terminal is started:

vi ~/.bashrc

...
neofetch

That's how we went about setting up the Neofetch utility, which displays system information and allows you to change images.