Open xbt573 opened 1 week ago
This PR is known to break alpine linux and debian.
The pretty name of apline linux is Alpine Linux v3.20
while its version is 3.20.0
, which results in OS: Alpine Linux v3.20 3.20.0 aarch64
It may also break debian. We fetch point release version of debian in /etc/debian_version
, while the pretty name of debian contains only the major version. so that fastfetch will print Debian GNU/Linux 12 (bookworm) 12.1 x86_64
. See https://github.com/dylanaraps/neofetch/issues/2381
Fastfetch uses NAME instead of PRETTY_NAME to generate more constant and accurate results. Unless this change gets tested in every linux distro, I want the old behavior being kept
I tested some popular distros with docker (and my own Gentoo), and i can categorize the results into some categories:
name
equals prettyName
: Arch Linux, Clear LinuxprettyName
contains version_id
(version duplication prevented by condition): Fedora, RockyLinuxname
is "starter kit"), Alma Linux (codename added, version duplication prevented by condition), Amazon Linux (version from prettyName
is more verbose), Gentoo LinuxI propose these solutions:
name
over prettyName
if exception list contains name
prettyName
by parts, will help with v3.20
-3.20.0
and similar, harderprettyName
(8 of 11 tested, 2 is rolling)I'm ready to assist with every solution you choose and test all fastfetch supported distros (by logo) if needed.
If none of solutions is suitable then just close this PR
I would rather fix the name
and version
.
For example: test if prettyName
contains name
+ " Linux"
PR title pretty much says all about changes in code. Currently fastfetch uses
os-release
'sname
overprettyName
, which are not always equal (for example Gentoo'sname
isGentoo
, butprettyName
isGentoo Linux
)This change just swaps order of
name
andprettyName
in if-else if-else chain