Added hidden_gpus option in the config
This commit is contained in:
parent
efdbe94193
commit
c4c71fc49a
@ -3,3 +3,4 @@ fetch_script: auto
|
|||||||
ansii_colors: []
|
ansii_colors: []
|
||||||
force_config_ansii: false
|
force_config_ansii: false
|
||||||
dependency_warning: true
|
dependency_warning: true
|
||||||
|
hidden_gpus: []
|
||||||
|
2
main.go
2
main.go
@ -22,6 +22,7 @@ var config = StormfetchConfig{
|
|||||||
AnsiiColors: make([]int, 0),
|
AnsiiColors: make([]int, 0),
|
||||||
ForceConfigAnsii: false,
|
ForceConfigAnsii: false,
|
||||||
DependencyWarning: true,
|
DependencyWarning: true,
|
||||||
|
HiddenGPUS: make([]int, 0),
|
||||||
}
|
}
|
||||||
|
|
||||||
type StormfetchConfig struct {
|
type StormfetchConfig struct {
|
||||||
@ -31,6 +32,7 @@ type StormfetchConfig struct {
|
|||||||
AnsiiColors []int `yaml:"ansii_colors"`
|
AnsiiColors []int `yaml:"ansii_colors"`
|
||||||
ForceConfigAnsii bool `yaml:"force_config_ansii"`
|
ForceConfigAnsii bool `yaml:"force_config_ansii"`
|
||||||
DependencyWarning bool `yaml:"dependency_warning"`
|
DependencyWarning bool `yaml:"dependency_warning"`
|
||||||
|
HiddenGPUS []int `yaml:"hidden_gpus"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
5
utils.go
5
utils.go
@ -130,7 +130,10 @@ func getGPUNames() []string {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return 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 {
|
if graphics.DeviceInfo != nil {
|
||||||
ret = append(ret, graphics.DeviceInfo.Product.Name)
|
ret = append(ret, graphics.DeviceInfo.Product.Name)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user