This is Cupid, the cat.
Cupid the cat loves Linux!
cupidfetch is a system information retrieval tool written in C for Linux systems. It's a beginner-friendly, work-in-progress hobby project aimed at learning and exploring programming concepts.
✔️ Fetches and displays various system details:
- Hostname
- Distribution (with auto-add for unknown distros — see below!)
- Kernel version
- Uptime
- Package count
- Shell
- Terminal
- Desktop environment
- Username
- Memory
- Signal Handling for Window Resize, automatically updates display with terminal resizing (
SIGWINCH
) - And more
✔️ Auto-add unknown distros to distros.def
:
If cupidfetch detects an unrecognized distro in /etc/os-release
, it automatically inserts a new line into distros.def
(under an "auto added" section) so the distro becomes recognized in subsequent runs.
⬜ Enhance visual representation (soon):
- ASCII art for distributions
- Unicode icons
✔️ Built for beginners:
- Simple code
- Easy to understand and contribute
Supported Distros:
- Debian (Ubuntu, elementary, Mint) [Verified ✔️]
- Arch (Manjaro, Artix, EndeavourOS) [Verified ✔️]
- Fedora [Verified ✔️]
- Others are in
data/distros.def
(now automatically updated if not recognized)
cupidfetch relies on the following components and tools:
-
C Compiler:
Written in C, requiring a C compiler. The recommended compiler is GCC. -
cupidconf:
cupidfetch now uses cupidconf instead of inih!- Allows more flexible configuration parsing, supporting wildcards (
*
) for key matching, list retrieval, etc.
- Allows more flexible configuration parsing, supporting wildcards (
-
Git:
- For cloning the repository.
Often available via your distro’s package manager. On Debian/Ubuntu-based systems:
sudo apt update && sudo apt install build-essential
Install through your distro’s package manager. On Debian/Ubuntu-based systems:
sudo apt install git
-
Clone the repository:
git clone https://github.com/frankischilling/cupidfetch
-
Compile:
make
Or manually:
gcc -o cupidfetch src/config.c src/main.c src/modules.c src/print.c libs/cupidconf.c
-
Run:
- From the current directory:
./cupidfetch
- From anywhere (optional):
sudo mv cupidfetch /usr/local/bin cupidfetch
- From the current directory:
-
Debug:
- Use
make clean asan
ormake clean ubsan
to check for overflows/memory leaks or undefined behavior.
- Use
-
View the Output:
Prints system info such as distro, kernel, uptime, etc., and displays ASCII art for recognized distros.
You can use the install-config.sh
script to create a configuration file for cupidfetch.
- Location:
or, if
${XDG_CONFIG_HOME}/cupidfetch/cupidfetch.conf
$XDG_CONFIG_HOME
is not set:$HOME/.config/cupidfetch/cupidfetch.conf
# List of modules (space-separated)
modules = hostname username distro linux_kernel uptime pkg term shell de ip memory cpu storage
# Memory display settings
memory.unit-str = MB
memory.unit-size = 1000000
# Storage display settings
storage.unit-str = GB
storage.unit-size = 1000000000
Adjust as needed; e.g., switch units to test different scale factors.
Whenever cupidfetch encounters a distro that isn’t listed in data/distros.def
, it:
- Warns you that the distro is unknown.
- Inserts a new
DISTRO("shortname", "Capitalized", "pacman -Q | wc -l")
entry intodistros.def
, under an/* auto added */
comment. - Re-parses
distros.def
, so subsequent runs show the proper distro name.
Note: The default package command is set to
pacman -Q | wc -l
. If your newly added distro uses a different package manager (e.g.,dpkg
,dnf
, or something else), you might want to editdistros.def
manually to change the package count command.
If you prefer manual updates (or want to tweak the auto-added lines), edit data/distros.def
. For example, to add “cupidOS” which uses dpkg
:
DISTRO("ubuntu" , "Ubuntu" , "dpkg -l | tail -n+6 | wc -l")
DISTRO("cupidOS", "cupidOS", "dpkg -l | tail -n+6 | wc -l")
However, thanks to auto-add, you often won’t need to touch this file for new distros—cupidfetch will do it for you!
If cupidfetch
cannot create a log file at .../cupidfetch/log.txt
, it falls back to stderr
.
To suppress logging:
cupidfetch 2> /dev/null
- Linux system
- Basic knowledge of C programming
- Curiosity for exploring system information
Everyone is welcome—beginner or expert!
- Discord: Join here
- Beginners: Great project to learn, ask questions, and try new ideas.
- Experienced devs: Help refine, optimize, or expand coverage for more distros.
- Add ASCII art for each distro (e.g., “Arch kitten saying ‘I use Arch btw’”)
- Add colors/user theming
- Fix alignment for proper ASCII art display
- Add Unicode icons (Nerd Fonts?)
-
make install
- Arch Linux AUR package
- Per-module config sections
- Implement dynamic WM & DE detection (remove hard-coded checks)
- Auto-detect and update distros in
distros.def
- Signal Handling for Window Resize (
SIGWINCH
) - Improve distro detection
- Add memory info
- Add storage info
- Fix terminal info, DE, and WM detection
- Implement a config system (migrated to cupidconf)
- Clean up code and improve display formatting
This project is a continuous work-in-progress for learning and experimentation. Expect frequent changes or refactoring as new features are added.