Skip to content

iinsertNameHere/catnip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


Catnip🌿 Systemfetch

View Demo Β· Installation Β· Basic Usage Β· Configuration Β· Contributing


🌿 What is Catnip

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.

⏱️ Execution Time

*Around 0.006 seconds on my laptop

πŸ“Š Displayed Statistics

View Statistics
  • username
  • hostname
  • uptime
  • os
  • kernel
  • desktop
  • shell
  • terminal
  • memory
  • disk space
  • cpu info
  • packages
  • colors

❀ Shoutout to:

Feel free to submit issues if you have any improvement ideas! ❀


πŸ“· Demo Images

Demo Images ✨

Default:

FigletLogos (Nitch mode):

Image Mode:

Distro Showcase:


πŸͺ‘ Installation/Build

1. Install nimπŸ‘‘ and all dependencies

Dependencies:

  • pcre
  • gzip

Optional:

  • figlet (required for figletLogos)
  • viu (required for imageMode)

2. Clone the repo:

git clone https://github.com/iinsertNameHere/catnip.git

3. Change dir to repo

cd ./catnip

4. Run install using nimπŸ‘‘:

nim install

NOTE: For the icons to work, make sure you set a NerdFont as you terminal font.


πŸ’» Usage

Run catnip in you terminal:

$ catnip

Change the distro icon using:

$ catnip -d <distro>

To get a full list of arguments use:

$ catnip --help

πŸ“’ Configuration

The 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 = "#"}

🎨 Colors:

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!.

🚩 Misc

In the misc section of config.toml you can find 3 keys.

  1. layout
  2. figletLogos
  3. imageMode

Layout

In the layout you can define how the logo and stats will be arranged.

  • Use Inline to place the logo and stats next to each other.
  • Use ArtOnTop to place the logo on top of the stats.
  • Use StatsOnTop to place the stats on top of the logo.

Figlet Logos

In the figletLogos section you can find 4 keys:

  1. enable
  2. color
  3. font
  4. margin
  • Set enable to true/false to enable or disable figlet generated logos.
  • Use color to set the color the figlet logos should have.
  • Use font to set what font figlet should use.
  • Use margin to define the margins of the figlet logos.

Image Mode

In the imageMode section you can find 4 keys:

  1. enable
  2. path
  3. scale
  4. margin
  • Set enable to true/false to enable or disable image mode.
  • Use path to define what image file to display.
  • Use scale to set the scale of the image.
  • Use margin to define the logo margins.

πŸ–ŒοΈ Distro Art

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.

  1. margin
  2. art
  3. alias

Margin

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]

Art

The art key is used to define the ascii-art for your distro. For example:

art = [
  "Test",
  "Test",
  "Test"
]

Alias

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"
]


Contributing

More info in CONTRIBUTING.md

Thanks to all contributors ❀



Star History Chart