I created Catnip🌿 as a playful, simple system-information concatenation tool using nim👑. It is quite customizable and has possibilities to alter the names and colors of the statistics. In the future, I also intend to add more distribution logos. Feel free to contribute to the project at any time.
*Around 0.006 seconds on my laptop
View Statistics
- username
- hostname
- uptime
- os
- kernel
- desktop
- shell
- terminal
- memory
- disk space
- cpu info
- packages
- colors
- NimParsers/parsetoml for the toml parsing
- ssleert/Nitch for the inspiration
- All contributors
Feel free to submit issues if you have any improvement ideas! ❤
Arch Linux users can install the catnip-git package from the AUR.
1. Install nim👑 and all dependencies
- pcre
- gzip
- figlet (required for figletLogos)
- viu (required for imageMode)
2. Clone the repo:
git clone https://github.com/iinsertNameHere/catnip.git3. Change dir to repo
cd ./catnip4. Run install using nim👑:
nim installImportant
For the icons to work, make sure you set a NerdFont as you terminal font.
Run catnip in you terminal:
$ catnipChange the distro icon using:
$ catnip -d <distro>To get a full list of arguments use:
$ catnip --helpThe config files are located at:
~/.config/catnip
You can change the names, colors, and icons for the various stats inside the stats section of the config.toml file.
Example stats section that does not use NerdFont icons:
##############################################
## FetchInfo stats Config ##
##############################################
[stats]
username = {icon = ">", name = "user", color = "(RD)"}
hostname = {icon = ">", name = "hname", color = "(YW)"}
uptime = {icon = ">", name = "uptime", color = "(BE)"}
distro = {icon = ">", name = "distro", color = "(GN)"}
kernel = {icon = ">", name = "kernel", color = "(MA)"}
desktop = {icon = ">", name = "desktp", color = "(CN)"}
terminal = {icon = ">", name = "term", color = "(RD)"}
shell = {icon = ">", name = "shell", color = "(MA)"}
cpu = {icon = ">", name = "cpu", color = "(RD)"}
disk_0 = {icon = ">", name = "disk", color = "(GN)"}
memory = {icon = ">", name = "memory", color = "(YW)"}
sep_color = "SEPARATOR"
colors = {icon = ">", name = "colors", color = "!DT!", symbol = "#"}If you don't want to display a stat, you can just comment out the line:
##############################################
## FetchInfo stats Config ##
##############################################
[stats]
username = {icon = ">", name = "user", color = "(RD)"}
hostname = {icon = ">", name = "hname", color = "(YW)"}
uptime = {icon = ">", name = "uptime", color = "(BE)"}
distro = {icon = ">", name = "distro", color = "(GN)"}
kernel = {icon = ">", name = "kernel", color = "(MA)"}
desktop = {icon = ">", name = "desktp", color = "(CN)"}
terminal = {icon = ">", name = "term", color = "(RD)"}
shell = {icon = ">", name = "shell", color = "(MA)"}
# cpu = {icon = ">", name = "cpu", color = "(RD)"}
# disk_0 = {icon = ">", name = "disk", color = "(GN)"}
memory = {icon = ">", name = "memory", color = "(YW)"}
sep_color = "SEPARATOR"
colors = {icon = ">", name = "colors", color = "!DT!", symbol = "#"}You can change the order in which the stats are displayed by just changing the order in the config:
##############################################
## FetchInfo stats Config ##
##############################################
[stats]
uptime = {icon = ">", name = "uptime", color = "(BE)"}
distro = {icon = ">", name = "distro", color = "(GN)"}
kernel = {icon = ">", name = "kernel", color = "(MA)"}
desktop = {icon = ">", name = "desktp", color = "(CN)"}
terminal = {icon = ">", name = "term", color = "(RD)"}
shell = {icon = ">", name = "shell", color = "(MA)"}
cpu = {icon = ">", name = "cpu", color = "(RD)"}
disk_0 = {icon = ">", name = "disk", color = "(GN)"}
memory = {icon = ">", name = "memory", color = "(YW)"}
# Username and hostname are now displayed at the bottom
username = {icon = ">", name = "user", color = "(RD)"}
hostname = {icon = ">", name = "hname", color = "(YW)"}
sep_color = "SEPARATOR"
colors = {icon = ">", name = "colors", color = "!DT!", symbol = "#"}Separators are defined by creating a new key with the sep_ prefix. The value of the key can be anything.
##############################################
## FetchInfo stats Config ##
##############################################
[stats]
username = {icon = ">", name = "user", color = "(RD)"}
hostname = {icon = ">", name = "hname", color = "(YW)"}
sep_1 = "SEPARATOR" # Separates uname and hname from rest
uptime = {icon = ">", name = "uptime", color = "(BE)"}
distro = {icon = ">", name = "distro", color = "(GN)"}
kernel = {icon = ">", name = "kernel", color = "(MA)"}
desktop = {icon = ">", name = "desktp", color = "(CN)"}
terminal = {icon = ">", name = "term", color = "(RD)"}
shell = {icon = ">", name = "shell", color = "(MA)"}
cpu = {icon = ">", name = "cpu", color = "(RD)"}
disk_0 = {icon = ">", name = "disk", color = "(GN)"}
memory = {icon = ">", name = "memory", color = "(YW)"}
sep_color = "SEPARATOR"
colors = {icon = ">", name = "colors", color = "!DT!", symbol = "#"}To display multiple disks, just create a new stat is named disk_[index]. To check what the index of the disk you want to add is, just run catnip -g disks.
##############################################
## FetchInfo stats Config ##
##############################################
[stats]
username = {icon = ">", name = "user", color = "(RD)"}
hostname = {icon = ">", name = "hname", color = "(YW)"}
sep_1 = "SEPARATOR" # Separates uname and hname from rest
uptime = {icon = ">", name = "uptime", color = "(BE)"}
distro = {icon = ">", name = "distro", color = "(GN)"}
kernel = {icon = ">", name = "kernel", color = "(MA)"}
desktop = {icon = ">", name = "desktp", color = "(CN)"}
terminal = {icon = ">", name = "term", color = "(RD)"}
shell = {icon = ">", name = "shell", color = "(MA)"}
cpu = {icon = ">", name = "cpu", color = "(RD)"}
disk_0 = {icon = ">", name = "disk", color = "(GN)"}
disk_1 = {icon = ">", name = "disk", color = "(GN)"} # New disk stat
memory = {icon = ">", name = "memory", color = "(YW)"}
sep_color = "SEPARATOR"
colors = {icon = ">", name = "colors", color = "!DT!", symbol = "#"}Catnip's color system uses a ColorId, which is made up of the colors first and last letter, enclosed in characters that indicate the type of color.
Color Types:
- Foreground Normal ->
(#) - Foreground Bright ->
{#} - Background Normal ->
[#] - Background Bright ->
<#>
Note
# Should be replaced by the color id.
Color IDs:
- BLACK ->
BK - RED ->
RD - GREEN ->
GN - YELLOW ->
YW - BLUE ->
BE - MAGENTA ->
MA - CYAN ->
CN - WHITE ->
WE
So {GN} translates to: Foreground-Bright-Green.
To set the color to Default, use !DT!.
In the misc section of config.toml you can find 3 keys.
layoutfigletLogosimageMode
In the layout you can define how the logo and stats will be arranged.
- Use
Inlineto place the logo and stats next to each other. - Use
ArtOnTopto place the logo on top of the stats. - Use
StatsOnTopto place the stats on top of the logo.
In the figletLogos section you can find 4 keys:
enablecolorfontmargin
- Set
enabletotrue/falseto enable or disable figlet generated logos. - Use
colorto set the color the figlet logos should have. - Use
fontto set what font figlet should use. - Use
marginto define the margins of the figlet logos.
In the imageMode section you can find 4 keys:
enablepathscalemargin
- Set
enabletotrue/falseto enable or disable image mode. - Use
pathto define what image file to display. - Use
scaleto set the scale of the image. - Use
marginto define the logo margins.
To create a new DistroArt object inside the distros.toml file, add a new section to the file (replace distroname with the name of your distro):
[distroname]Catnip's DistroArt Objects have three possible keys.
marginartalias
The margin key is used to define the top, left and right margins of the art. For example:
Art with
margin = [0, 0, 0]
Art with
margin = [3, 3, 3]
The art key is used to define the ascii-art for your distro.
For example:
art = [
"Test",
"Test",
"Test"
]
The alias key can be used to define alternate names that should also refer to the DistroArt Object.
Example in which 'test1' also refers to your new DistroArt object:
alias = "test1"
This is also used to define the default DistroArt object, which defines what art should be displayed by default.
Example DistroArt object:
[distroart.test]
alias = "test1"
margin = [3, 3 ,3]
art = [
"Test",
"Test",
"Test"
]
To test Catnip, run the following command in the Catnip repo:
$ cd tests/
$ ./commandline_args.shMore info in CONTRIBUTING.md




