Skip to content

Add TUXEDO OS #1000

@towo2099

Description

@towo2099

Wanted features:

It would be nixe, if fastfetch would detect TUXEDO OS, like neofetch has.

Motivation:

As fastfetch should be the succeror of neofetch, it should detect TUXEDO OS

Possible Patch

diff -ruN fastfetch/src/detection/os/os_linux.c fastfetch-tuxedo/src/detection/os/os_linux.c
--- fastfetch/src/detection/os/os_linux.c       2024-06-06 14:19:21.725260367 +0200
+++ fastfetch-tuxedo/src/detection/os/os_linux.c        2024-06-06 14:12:10.592082778 +0200
@@ -52,7 +52,7 @@
     if(!ffStrSet(xdgConfigDirs))
         return;

-    if(strstr(xdgConfigDirs, "kde") != NULL || strstr(xdgConfigDirs, "plasma") != NULL)
+    if(strstr(xdgConfigDirs, "kde") != NULL || strstr(xdgConfigDirs, "plasma") != NULL || strstr(xdgConfigDirs, "kubuntu") != NULL)
     {
         ffStrbufSetS(&result->name, "Kubuntu");
         ffStrbufSetS(&result->prettyName, "Kubuntu");
@@ -223,6 +223,18 @@
             ffStrbufClear(&os->version);
     }

+    // Hack for TUXEDO OS Logo.
+    if(parseOsRelease(FASTFETCH_TARGET_DIR_ETC "/os-release", os))
+    {
+       if (ffStrbufEqualS(&os->name, "TUXEDO OS"))
+       {
+           ffStrbufSetStatic(&os->name, "TUXEDO OS");
+           ffStrbufSetStatic(&os->idLike, "TUXEDO OS");
+           ffStrbufSetStatic(&os->id, "TUXEDO OS");
+           return;
+       }
+    }
+
     if(parseOsRelease(FASTFETCH_TARGET_DIR_ETC "/os-release", os) && allRelevantValuesSet(os))
         return;

@@ -233,7 +245,7 @@
 {
     detectOS(os);

-    if(ffStrbufIgnCaseEqualS(&os->id, "ubuntu"))
+    if(ffStrbufIgnCaseEqualS(&os->id, "ubuntu") && ffStrbufIgnCaseEqualS(&os->name, "ubuntu"))
         getUbuntuFlavour(os);
     else if(ffStrbufIgnCaseEqualS(&os->id, "debian"))
     {

Maybe it would be possible more elegant.
PS: Since the release does not detect kubuntu 24.04 live session, i have added it too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions