A Bash script that automatically changes the ASCII logo and associated colors in Fastfetch every time a Konsole terminal is opened.
The script randomly selects a logo from a JSON list, applies its associated color scheme, and launches Fastfetch automatically through .bashrc.
- 🎲 Random Fastfetch logo selection
- 🎨 Custom color palette per logo
- 🖼️ Support for custom ASCII logos
- 🚀 Automatic execution when opening Konsole
- 🐧 Compatible with Nobara 44 / Fedora and other Bash-based Linux distributions
- ⚡ No permanent modification of
config.jsonc - 🔒 Prevents accidental Fastfetch configuration corruption
The expected file structure is:
~/.config/fastfetch/
│
├── config.jsonc
│
├── random-fastfetch.sh
│
└── logos/
│
├── list.json
├── logo1.txt
├── logo2.txt
├── logo3.txt
└── ...
The script uses jq to read JSON files.
On Nobara/Fedora:
sudo dnf install jqmkdir -p ~/.config/fastfetch/logosPlace your custom ASCII files inside:
~/.config/fastfetch/logos/
Example:
logo1.txt
logo2.txt
logo3.txt
Each file should contain only the ASCII art.
Create the file:
~/.config/fastfetch/logos/list.json
Example:
{
"logos": [
{
"path": "/home/neon/.config/fastfetch/logos/logo1.txt",
"colors": {
"1": "blue",
"2": "cyan"
}
},
{
"path": "/home/neon/.config/fastfetch/logos/logo2.txt",
"colors": {
"1": "red",
"2": "yellow"
}
},
{
"path": "/home/neon/.config/fastfetch/logos/logo3.txt",
"colors": {
"1": "green",
"2": "white"
}
}
]
}Defines the location of the ASCII logo:
"path": "/home/neon/.config/fastfetch/logos/logo1.txt"Defines the Fastfetch logo color mapping:
"colors": {
"1": "blue",
"2": "cyan"
}The numbers correspond to Fastfetch color markers inside the ASCII file.
Example:
$1████████
$2██ NOBARA ██
Result:
$1→ blue$2→ cyan
Create the script:
nano ~/.config/fastfetch/random-fastfetch.shAdd:
#!/bin/bash
FASTFETCH_DIR="$HOME/.config/fastfetch"
LIST="$FASTFETCH_DIR/logos/list.json"
COUNT=$(jq '.logos | length' "$LIST")
INDEX=$((RANDOM % COUNT))
LOGO=$(jq -r ".logos[$INDEX].path" "$LIST")
COLOR1=$(jq -r ".logos[$INDEX].colors[\"1\"]" "$LIST")
COLOR2=$(jq -r ".logos[$INDEX].colors[\"2\"] // empty" "$LIST")
fastfetch \
--logo-type file \
--logo "$LOGO" \
--logo-color-1 "$COLOR1" \
${COLOR2:+--logo-color-2 "$COLOR2"}chmod +x ~/.config/fastfetch/random-fastfetch.shTest it manually:
~/.config/fastfetch/random-fastfetch.shEdit your Bash configuration:
nano ~/.bashrcAdd at the end:
# Random Fastfetch logo on Konsole startup
if [[ $- == *i* ]]; then
~/.config/fastfetch/random-fastfetch.sh
fiFrom now on, every time Konsole starts:
- Bash loads
.bashrc - The script runs
- A random logo is selected
- The associated colors are applied
- Fastfetch displays the result
Error:
Permission denied
Fix:
chmod +x ~/.config/fastfetch/random-fastfetch.shCheck your JSON file:
jq . ~/.config/fastfetch/logos/list.jsonIf the file contains syntax errors, jq will display the problematic line.
Test manually:
fastfetch \
--logo-type file \
--logo ~/.config/fastfetch/logos/logo1.txtThis system can easily be extended:
- Add new logos by dropping additional
.txtfiles - Create custom color themes
- Add distribution-specific logos
- Change themes depending on time of day
- Select logos depending on GPU or KDE Plasma theme
Personal Linux customization project.
Free to use and modify.