- Published on
Configure Neofetch with Images Using Kitty
- Authors
- Name
- Ayden Jahola
Table of Contents
Introduction
Neofetch is a command-line system information tool written in bash 3.2+. Neofetch displays information about your system next to an image, your OS logo, or any ASCII file of your choice. The main purpose of Neofetch is to be used in screenshots to show other users what OS/Distro you're running, what Theme/Icons you're using, etc.
In this guide, I will show you how to configure Neofetch to display images in the terminal using kitty terminal emulator.
Prerequisites
- kitty installed on your system.
- Neofetch installed on your system.
- An image you want to display in the terminal.
Install kitty
If you don't have kitty installed on your system, you can install it using your package manager. Here's how to install kitty on some popular Linux distributions:
Arch Linux
sudo pacman -S kitty
Ubuntu/Debian
sudo apt install kitty
Install Neofetch
If you don't have Neofetch installed on your system, you can install it using your package manager. Here's how to install Neofetch on some popular Linux distributions:
Arch Linux
sudo pacman -S neofetch
Ubuntu/Debian
sudo apt install neofetch
Terminal Emulator Compatibility with Images
The table below lists the testing of various terminal emulators, what works and what doesn't.
Taken from Neofetch Wiki
Terminal Emulator | w3m-img | Quirks |
---|---|---|
Gnome-terminal | Yes | - Image disappears on window focus and resize |
- Possible issues on Fedora, see #295 | ||
iTerm | N/A | See [1] |
konsole | Yes | |
st | Yes | - Image disappears on window focus and resize |
Terminator | Yes | - Image disappears on window focus and resize |
Terminology | N/A | See [2] |
Termite | Yes | - Highlighting the image makes the highlighted parts disappear |
tilda | No | |
URxvt | Yes | - Image disappears on window focus and resize |
Xfce4-terminal | Yes | - Image disappears on window focus and resize |
Xterm | Yes | |
kitty | N/A | See [3] |
alacritty | No |
[1] iTerm doesn't require w3m-img
to display images. Instead it uses a set of escape sequences built into iTerm.
[2] Terminology doesn't require w3m-img
to display images. Instead it uses a builtin program called tycat
.
[3] kitty doesn't require w3m-img
to display images. Instead it uses a builtin program called kitty +kitten icat
.
Note: For image mode to work, the w3m-img
column must say yes
and you must have the dependencies installed.
Configuration
First, you need to have an image that you want to display in the terminal. You can use any image you want, but I recommend using an image with a transparent background (png) for the best results. my full neofetch configs can be found here
Once you have your image, you need to place it somewhere, the best place to put it is in the neofetch config directory, which is located at ~/.config/neofetch/
:
# create directory to store the pngs
mkdir -p ~/.config/neofetch/pngs
# copy the image to the pngs directory
cp /path/to/your/image.png ~/.config/neofetch/pngs/
Next, you need to edit your neofetch config file, which is located at ~/.config/neofetch/config.conf
:
# open the config file in your favorite text editor
vim ~/.config/neofetch/config.conf
change the following lines in the config file:
# change the image backend to kitty
image_backend="kitty"
# grab all the pngs in the pngs directory and select a random one
image_source=$(find "${XDG_CONFIG_HOME:-$HOME/.config}/neofetch/pngs/" -name "*.png" | sort -R | head -1)
# change the image size to fit your terminal
image_size="270px"
(optional) you can also change the crop mode to fit your terminal. see here for more details.
# using the normal crop mode (default)
crop_mode="normal"
Now, when you run neofetch
in your terminal, you should see your image displayed next to your system information.
Example
here's an example of what your terminal should look like after configuring Neofetch to display images using kitty:
(your terminal may look different depending on your terminal theme and the image you choose)
Conclusion
That's it! You've successfully configured Neofetch to display images in the terminal using kitty. You can now show off your system information in style!
If you have any questions or run into any issues, feel free to reach out to me on Email or Github. I'd be happy to help you out.