Guard ethtool usage.

This commit is contained in:
Turann_
2026-03-15 22:07:04 +03:00
parent e6fc9dc700
commit a5af3e83d6
2 changed files with 7 additions and 2 deletions
+4 -1
View File
@@ -779,10 +779,13 @@ Singleton {
root.activeEthernetDetails = details;
root.activeEthernetDetailsTimestamp = Date.now();
root.ethernetDetailsLoading = false;
} else {
} else if (ProgramCheckerService.ethtoolAvailable) {
// Fallback to ethtool if sysfs unreadable or invalid
ethernetEthtoolProcess.ifname = ethernetSysfsSpeedProcess.ifname;
ethernetEthtoolProcess.running = true;
} else {
root.activeEthernetDetailsTimestamp = Date.now();
root.ethernetDetailsLoading = false;
}
}
}
+3 -1
View File
@@ -17,6 +17,7 @@ Singleton {
property bool gnomeCalendarAvailable: false
property bool pythonAvailable: false
property bool wtypeAvailable: false
property bool ethtoolAvailable: false
// Programs to check - maps property names to commands
readonly property var programsToCheck: ({
@@ -25,7 +26,8 @@ Singleton {
"wlsunsetAvailable": ["sh", "-c", "command -v wlsunset"],
"gnomeCalendarAvailable": ["sh", "-c", "command -v gnome-calendar"],
"wtypeAvailable": ["sh", "-c", "command -v wtype"],
"pythonAvailable": ["sh", "-c", "command -v python3"]
"pythonAvailable": ["sh", "-c", "command -v python3"],
"ethtoolAvailable": ["sh", "-c", "command -v ethtool"]
})
// Discord client auto-detection