Improve motherboard module

This commit is contained in:
2025-12-21 16:36:24 +02:00
parent 663e69638b
commit d1b095ba73
+8 -1
View File
@@ -152,10 +152,17 @@ func initializeModuleMap() {
// Motherboard module // Motherboard module
MotherboardModule := StormfetchModule{stormfetchModuleConfig: stormfetchModuleConfig{Name: "motherboard", Format: "%3Motherboard: %4$MOTHERBOARD"}, Execute: func(sm StormfetchModule) string { MotherboardModule := StormfetchModule{stormfetchModuleConfig: stormfetchModuleConfig{Name: "motherboard", Format: "%3Motherboard: %4$MOTHERBOARD"}, Execute: func(sm StormfetchModule) string {
motherboard := GetMotherboardModel()
// Return empty string if can't detect motherboard model
if motherboard == "" {
return ""
}
return os.Expand(sm.Format, func(s string) string { return os.Expand(sm.Format, func(s string) string {
switch s { switch s {
case "MOTHERBOARD": case "MOTHERBOARD":
return GetMotherboardModel() return motherboard
default: default:
return "" return ""
} }