Added hidden_gpus option in the config

This commit is contained in:
CapCreeperGR 2024-06-09 14:45:17 +03:00
parent efdbe94193
commit c4c71fc49a
3 changed files with 7 additions and 1 deletions

View File

@ -3,3 +3,4 @@ fetch_script: auto
ansii_colors: []
force_config_ansii: false
dependency_warning: true
hidden_gpus: []

View File

@ -22,6 +22,7 @@ var config = StormfetchConfig{
AnsiiColors: make([]int, 0),
ForceConfigAnsii: false,
DependencyWarning: true,
HiddenGPUS: make([]int, 0),
}
type StormfetchConfig struct {
@ -31,6 +32,7 @@ type StormfetchConfig struct {
AnsiiColors []int `yaml:"ansii_colors"`
ForceConfigAnsii bool `yaml:"force_config_ansii"`
DependencyWarning bool `yaml:"dependency_warning"`
HiddenGPUS []int `yaml:"hidden_gpus"`
}
func main() {

View File

@ -130,7 +130,10 @@ func getGPUNames() []string {
if err != nil {
return nil
}
for _, graphics := range gpu.GraphicsCards {
for i, graphics := range gpu.GraphicsCards {
if slices.Contains(config.HiddenGPUS, i+1) {
continue
}
if graphics.DeviceInfo != nil {
ret = append(ret, graphics.DeviceInfo.Product.Name)
}