Skip to content

Configuration

LivacoNew edited this page Apr 7, 2024 · 4 revisions

One of CrabFetch's goals is to be as configurable as possible, and such this page will explain to you how to do such thing.

Generating the Config File

CrabFetch will generate a default config file if you run crabfetch -g
This will place a config file in one of two places;

  • $XDG_CONFIG_HOME/CrabFetch/config.toml
  • Or, if $XDG_CONFIG_HOME isn't set $HOME/.config/CrabFetch/config.toml

If you want to figure it out for yourself, you can also just manually make the files if you choose so.

Basic Configuration

The config file is written in TOML. The top "modules" array defines what modules to display in what order. You can type any of the accepted modules in the comment above it. You can also use;

  • underline:{length} to make a "underline" of dashes e.g underline:10
  • segment:{name} to make a segment, well moreso kind of a "header".

Below that you can also define the "seperator", which separates the modules name from it's value, as well as some more default formatting options.

ASCII Configuration

By default the ASCII will get set automatically depending on your distro and if the ASCII is included in CrabFetch. If your distro's ASCII doesn't work, make a issue and I'll add it in.
If you want to set your ASCII to something else, you can make the file .config/CrabFetch/ascii and place your own ASCII art in there. This will override the ASCII and drop in whatever you place in.

You can also make the ASCII use bands of color in the colors array.

Module Configuration

All modules require two variables; title and format.

  • title dictates the title of the module. If empty, the title and separator will be left out.
  • format is the output of the module. Placeholders for this are typically placed in the above comment in the config.

If format is missing, it means it's just a single placeholder being placed into the format. You can still override this if you wish.
You can also place color placeholders in format, e.g the default hostname format;

format = "{color-brightmagenta}{username}{color-white}@{color-brightmagenta}{hostname}"

Some modules may have their own required variables too. If this is the case they will be present and explained in the config comments.

You can also override some generic arguments per module, including;

  • title_color, title_bold and title_italic
  • seperator
  • decimal_places (sometimes) These will only be used for that one module and no more. Simply place them in with the rest of the module's section.