mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 15:37:23 +00:00
extend temperature sensors
This commit is contained in:
parent
0555185044
commit
b6ade7310a
@ -84,6 +84,7 @@ QStringList AWDataEngineMapper::registerSource(const QString &_source, const KSy
|
||||
// regular expressions
|
||||
auto cpuRegExp = QRegularExpression("^cpu/cpu.*/usage$");
|
||||
auto cpuclRegExp = QRegularExpression("^cpu/cpu.*/frequency$");
|
||||
auto cpuTempRegExp = QRegularExpression("^cpu/cpu.*/temperature$");
|
||||
auto hddrRegExp = QRegularExpression("^disk/.*/read$");
|
||||
auto hddwRegExp = QRegularExpression("^disk/.*/write$");
|
||||
auto mountFillRegExp = QRegularExpression("^disk/.*/usedPercent$");
|
||||
@ -346,9 +347,9 @@ QStringList AWDataEngineMapper::registerSource(const QString &_source, const KSy
|
||||
// gb
|
||||
m_map.insert(_source, "swapgb");
|
||||
m_formatter["swapgb"] = AWKeysAggregator::FormatterType::MemGBFormat;
|
||||
} else if (_source.startsWith("lmsensors/")) {
|
||||
} else if (_source.startsWith("lmsensors/") || _source.contains(cpuTempRegExp) || _source == "cpu/all/averageTemperature") {
|
||||
// temperature
|
||||
int index = m_devices["temp"].indexOf(_source);
|
||||
auto index = m_devices["temp"].indexOf(_source);
|
||||
// HACK on DE initialization there are no units key
|
||||
if (_units == KSysGuard::UnitInvalid)
|
||||
return QStringList({QString("temp%1").arg(index)});
|
||||
|
@ -304,6 +304,7 @@ void AWKeyOperations::addDevice(const QString &_source)
|
||||
|
||||
auto diskRegexp = QRegularExpression("disk/(?:md|sd|hd)[a-z|0-9]_.*/Rate/(?:rblk)");
|
||||
auto mountRegexp = QRegularExpression("partitions/.*/filllevel");
|
||||
auto cpuTempRegExp = QRegularExpression("^cpu/cpu.*/temperature$");
|
||||
|
||||
if (_source.contains(diskRegexp)) {
|
||||
QString device = _source;
|
||||
@ -313,7 +314,7 @@ void AWKeyOperations::addDevice(const QString &_source)
|
||||
QString device = _source;
|
||||
device.remove("partitions").remove("/filllevel");
|
||||
addKeyToCache("mount", device);
|
||||
} else if (_source.startsWith("lmsensors")) {
|
||||
} else if (_source.startsWith("lmsensors") || _source.contains(cpuTempRegExp) || _source == "cpu/all/averageTemperature") {
|
||||
addKeyToCache("temp", _source);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user