Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TUXEDO OS #1000

Closed
towo2099 opened this issue Jun 6, 2024 · 11 comments
Closed

Add TUXEDO OS #1000

towo2099 opened this issue Jun 6, 2024 · 11 comments
Labels
enhancement New feature or request

Comments

@towo2099
Copy link

towo2099 commented Jun 6, 2024

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.

@towo2099 towo2099 added the enhancement New feature or request label Jun 6, 2024
@CarterLi
Copy link
Member

CarterLi commented Jun 6, 2024

What does cat /etc/os-release print?

@towo2099
Copy link
Author

towo2099 commented Jun 6, 2024

st@test:~$ cat /etc/os-release 
NAME="TUXEDO OS"
VERSION="2 22.04.4"
ID=tuxedo
ID_LIKE="ubuntu debian"
PRETTY_NAME="TUXEDO OS 2"
VERSION_ID="22.04"
HOME_URL="https://tuxedocomputers.com/"
SUPPORT_URL="https://support.tuxedocomputers.com/"
BUG_REPORT_URL="https://gitlab.com/tuxedocomputers/development/tuxedo_os/os"
PRIVACY_POLICY_URL="https://www.tuxedocomputers.com/en/Privacy-policy.tuxedo"
VERSION_CODENAME=jammy
UBUNTU_CODENAME=jammy

@CarterLi
Copy link
Member

CarterLi commented Jun 6, 2024

Try this please

diff --git a/src/logo/builtin.c b/src/logo/builtin.c
index 0c92a20c..9d714400 100644
--- a/src/logo/builtin.c
+++ b/src/logo/builtin.c
@@ -4102,7 +4102,7 @@ static const FFlogo T[] = {
     },
     // TuxedoOS
     {
-        .names = {"Tuxedo OS"},
+        .names = {"tuxedo", "Tuxedo OS"},
         .lines = FASTFETCH_DATATEXT_LOGO_TUXEDO_OS,
         .colors = {
             FF_COLOR_FG_WHITE,

@towo2099
Copy link
Author

towo2099 commented Jun 6, 2024

It's not only the logo, it's even the OS String in the text output

grafik

@CarterLi
Copy link
Member

CarterLi commented Jun 6, 2024

What does cat /etc/lsb-release print?

@towo2099
Copy link
Author

towo2099 commented Jun 6, 2024

The logo-code does not help.

The Problem is

if(ffStrbufIgnCaseEqualS(&os->id, "ubuntu"))
    if(ffStrbufIgnCaseEqualS(&os->id, "ubuntu")
         getUbuntuFlavour(os);

@towo2099
Copy link
Author

towo2099 commented Jun 6, 2024

test@test:~/Downloads$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="TUXEDO OS 2 22.04.4 LTS"

@CarterLi
Copy link
Member

CarterLi commented Jun 6, 2024

test@test:~/Downloads$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="TUXEDO OS 2 22.04.4 LTS"

This is the problem.

@towo2099
Copy link
Author

towo2099 commented Jun 6, 2024

Not really, with my patch, it works as it should and is similar to the MX-Hack.
My patched version is working fine

grafik

@CarterLi
Copy link
Member

CarterLi commented Jun 6, 2024

The MX-hack is the problem. Prioritizing /etc/lsb-release over /etc/os-release breaks too many distros. I'm considering revert the hack.

@towo2099
Copy link
Author

towo2099 commented Jun 6, 2024

The real problem is, if we want to be compatible as possible with the corresponding ubuntu, we can't change

DISTRIB_ID=Ubuntu
VERSION_CODENAME=jammy
UBUNTU_CODENAME=jammy

since 3rd party apps check those vallues.

CarterLi added a commit that referenced this issue Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants