fastfetch icon indicating copy to clipboard operation
fastfetch copied to clipboard

[FEAT] Secondary key in modules

Open Sigmanificient opened this issue 1 year ago • 5 comments

Wanted features:

The ability to set a secondary key in every module list.

{
  "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
  "logo": {
    "padding": {
      "top": 2
    }
  },
  "display": { "separator": " ➜ " },
  "modules": [
    { "type": "title",  "keyWidth": 10 },
    "break",
    { "type": "os",       "key": "OS",          "keyColor": "white" },
    { "type": "kernel",   "key": "├ Kernel",    "keyColor": "white" },
    { "type": "packages", "key": "├ Packages",  "keyColor": "white" },
    { "type": "uptime",   "key": "└ Uptime",    "keyColor": "white" }
  ]
}

Example

  "display": {
    "separator": " ➜ "
  },
  "modules": [
    {
      "type": "kernel",
      "key": "├",
      "keyColor": "white",
      "secondary": "kernel",
      "keyColor": "blue"
    },
  ],

Motivation:

I would like to migrate my old neofetch config, but i cannot reproduce it using the current configuration.

Currently, with available module settings

image

What i would like to reproduce

image

Sigmanificient avatar May 04 '24 14:05 Sigmanificient

You may insert ANSI escape code directly in key

eg:

    {
      "type": "kernel",
      "key": "├ \u001b[34mkernel"
    }

Seems ugly though.

CarterLi avatar May 04 '24 15:05 CarterLi

    {
      "type": "kernel",
      "key": "├ \u001b[34mkernel"
    }

I guess the following configuration error:

Error: failed to parse JSON config file `/home/sigmanificient/.config/fastfetch/config.jsonc` at pos 513: unexpected character

I may already by fixed, packages version is fastfetch 2.10.2 (x86_64) here.

Sigmanificient avatar May 04 '24 15:05 Sigmanificient

It also does it on the latest vresion i just built (fastfetch 2.11.3 (x86_64))

Sigmanificient avatar May 04 '24 15:05 Sigmanificient

It was weird. Can you upload your config file for investigation?

CarterLi avatar May 04 '24 16:05 CarterLi

{
    "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
    "logo": {
        "padding": {
            "top": 2
        }
    },
    "display": {
        "separator": " ➜ "
    },
    "modules": [
        {
            "type": "title",
            "keyWidth": 10
        },
        "break",
        {
            "type": "os",
            "key": "OS",
            "keyColor": "white"
        },
    {
      "type": "kernel",
      "key": "├ \u001b[34mkernel"
    }
        {
            "type": "packages",
            "key": "├ Packages",
            "keyColor": "white"
        },
        {
            "type": "uptime",
            "key": "└ Uptime",
            "keyColor": "white"
        }
    ]
}

Sigmanificient avatar May 04 '24 20:05 Sigmanificient

You missed a comma after { "type": "kernel", "key": "├ \u001b[34mkernel" }

CarterLi avatar May 04 '24 23:05 CarterLi

You missed a comma after { "type": "kernel", "key": "├ \u001b[34mkernel" }

Oops my bad

Sigmanificient avatar May 05 '24 11:05 Sigmanificient