-
|
Hello there. My PC has an integrated GPU and a dedicated GPU. My laptop only has an integrated GPU. Is there any way to write a single config file for both systems that only displays the dedicated GPU if there is any and only falls back to displaying the integrated GPU if there is no dedicated GPU? In other words: I want to display only my dedicated GPU on my PC, but not the integrated GPU, and display my integrated GPU on my laptop. If there is no way to achieve this I will just write a second config file. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Should have been {
"modules": [
{
"type": "gpu",
"hideType": "integrated"
},
{
"condition": {
"succeeded": false // When no discrete GPU is found, the last run should return an error, then this module should run.
},
"type": "gpu"
}
]
}However, as I said in reddit, due to a bug, This has been fixed in e24e3b6 |
Beta Was this translation helpful? Give feedback.
-
|
There is another approach if you use the newest version v2.64.2 with lua builtin. // config.json5
{
$schema: "file:///C:/msys64/home/zhang/fastfetch/doc/json_schema.json",
logo: null,
modules: [
{
type: "gpu",
format: "lua:gpus = gpus or {}; table.insert(gpus, ...)", // will be called for each GPU
},
{
type: "custom", // prints dGPU if exists, otherwise iGPU
key: "GPU",
format: "lua:\
gpus = gpus or {};\
local dgpu = nil;\
for i, gpu in ipairs(gpus) do\
if gpu.type == 'Discrete' then\
dgpu = gpu;\
break;\
end;\
end;\
if dgpu then\
return dgpu.vendor .. ' ' .. dgpu.name;\
elseif gpus[1] then\
return gpus[1].vendor .. ' ' .. gpus[1].name;\
end",
},
],
}Kinda weird but it does work. |
Beta Was this translation helpful? Give feedback.
Should have been
{ "modules": [ { "type": "gpu", "hideType": "integrated" }, { "condition": { "succeeded": false // When no discrete GPU is found, the last run should return an error, then this module should run. }, "type": "gpu" } ] }However, as I said in reddit, due to a bug,
{ "type": "gpu", "hideType": "integrated" }doesn't return an error so the second module entry never runs.This has been fixed in e24e3b6