Skip to content

Conversation

@CarterLi
Copy link
Member

image

@LinusDierheimer
Copy link
Collaborator

Can we strip Apple and Intel prefixes from the GPU name and set vendor accordingly? Would not only give a prettier output, but format strings would work better too.

Personally i would also remove the Graphics suffix.

@CarterLi
Copy link
Member Author

Problem is that the string format returned is not guaranteed. What about AMD graphic cards?

@LinusDierheimer
Copy link
Collaborator

LinusDierheimer commented Sep 16, 2022

I would write code similar to this (don't blindly copy it, i am writing this directly on github):

ffStrbufRemoveIgnCaseEndS(&name, "Graphics");
ffStrbufTrimRight(&name);

char intelPrefix[] = "AppleIntel";
char applePrefix[] = "Apple";

if(ffStrbufStartsWithIgnCaseS(&name, intelPrefix)
{
    ffStrbufSubstrAfter(&name, sizeof(intelPrefix));
    ffStrbufAppendS(&vendor, "Intel");
}
else if(ffStrbufStartsWithIgnCaseS(&name, applePrefix)
{
    ffStrbufSubstrAfter(&name, sizeof(applePrefix));
    ffStrbufAppendS(&vendor, "Apple");
}

ffStrbufTrimLeft(&name);

@CarterLi
Copy link
Member Author

Updated, now we can correctly detect Intel Iris graphics

image

As for vendor, I don't think I want to do it before I can verify whether it works for other graphic cards.

@LinusDierheimer
Copy link
Collaborator

Thank you.

@LinusDierheimer LinusDierheimer merged commit bd65732 into fastfetch-cli:master Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants