Merge pull request #38 from Guaxinim5573/main

Add GPU support
This commit is contained in:
TheDarkBug 2021-03-14 22:58:10 +01:00 committed by GitHub
commit 81532e5571
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -199,9 +199,10 @@ void get_info() { // get all necessary info
fclose(meminfo);
// gpu
FILE *gpu = popen("lspci -vnn | grep 'VGA\\|DISPLAY\\|3D'", "r");
FILE *gpu = popen("lspci -mm | grep \"VGA\\|00:02\" | cut --fields=4,6 -d '\"' --output-delimiter=\" \" | sed \"s/ Controller.*//\"", "r");
if (gpu) {
//fscanf(gpu, "%[^\n]", gpu_model);
// Ignore error
if(fscanf(gpu, "%[^\n]", gpu_model) == 3) {};
fclose(gpu);
}