fastfetch-cli / fastfetch

An actively maintained, feature-rich and performance oriented, neofetch like system information tool.
MIT License
9.93k stars 395 forks source link

[FEAT] Module to display upstream distro(s) #1016

Closed ParticleMon closed 2 months ago

ParticleMon commented 3 months ago

Wanted features:

Display the name, code name, and version information of the upstream distro(s) if applicable and available.

Motivation:

Whether regarding OS configuration or driver or software installation or compatibility, one must know the OS.

Knowing the names of the upstream distro may be only partially helpful, especially if the OS is a fork, a fork of a fork, and so on. One might need to know the name, code name, and/or version number. But not all of this information may be available or the location(s) known.

Suggestions

Name the module "upstream" or "upstreamos." Including this module would print "Upstream OS: " followed by info obtained from a command or commands, such as the following:

ubuntu=$(sed 's/UBUNTU_CODENAME=//;t;d' /etc/os-release) debian=$(cat /etc/debian_version)

Then some pseudo-code, such as: if OS = Debian, return '' if OS = Ubuntu, return $debian if OS = Linux Mint, return $ubuntu, $debian

CarterLi commented 3 months ago

Does fastfetch -s os --os-format '{id-like}' work for you?

ParticleMon commented 3 months ago

Does fastfetch -s os --os-format '{id-like}' work for you?

Relative to my request, partially. On LM, in addition to the logo, this displays "OS: ubuntu debian"; thus not each distro's code name nor version number.

ParticleMon commented 3 months ago

At least on my distro, this file contains the code name and version of the immediate upstream distro: /etc/upstream-release/lsb-release

This tailored command module lacks only the upstream's upstream version:

    {
        "type": "command",
        "text": "sed 's/DISTRIB_RELEASE=/Ubuntu /;t;d' /etc/upstream-release/lsb-release | tr -d '\n'; sed 's/DISTRIB_CODENAME=/ /;t;d' /etc/upstream-release/lsb-release | tr -d '\"\n'; echo -n ', Debian '; cat /etc/debian_version",
        "key": "Upstream"
    }

Possibilities for obtaining all upstream distro lineage info include: 1. from the OS (currently impossible?), 2. hard-coded (possible), 3. another program (unknown), or 4. an online file (unknown, but ideally something like a text version of https://itsfoss.com/linux-code-names that's as thorough as https://distrowatch.com).