mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 23:47:20 +00:00
added support of cmd to dataengine
This commit is contained in:
parent
5c861b3814
commit
8e318a99d0
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@ sources/build
|
||||
sources/usr
|
||||
*src.tar.xz
|
||||
*src.tar.gz
|
||||
build
|
||||
|
@ -90,6 +90,7 @@ void ExtendedSysMon::readConfiguration()
|
||||
rawConfig[QString("CUSTOM")] = QString("wget -qO- http://ifconfig.me/ip");
|
||||
rawConfig[QString("GPUDEV")] = QString("auto");
|
||||
rawConfig[QString("HDDDEV")] = QString("all");
|
||||
rawConfig[QString("HDDTEMPCMD")] = QString("sudo hddtemp");
|
||||
rawConfig[QString("MPDADDRESS")] = QString("localhost");
|
||||
rawConfig[QString("MPDPORT")] = QString("6600");
|
||||
rawConfig[QString("PKGCMD")] = QString("pacman -Qu");
|
||||
@ -233,12 +234,12 @@ float ExtendedSysMon::getGpuTemp(const QString device)
|
||||
}
|
||||
|
||||
|
||||
float ExtendedSysMon::getHddTemp(const QString device)
|
||||
float ExtendedSysMon::getHddTemp(const QString cmd, const QString device)
|
||||
{
|
||||
float hddTemp = 0.0;
|
||||
QProcess command;
|
||||
QString qoutput = QString("");
|
||||
command.start(QString("sudo hddtemp ") + device);
|
||||
command.start(cmd + QString(" ") + device);
|
||||
command.waitForFinished(-1);
|
||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(command.readAllStandardOutput()).trimmed();
|
||||
if (qoutput.split(QChar(':'), QString::SkipEmptyParts).count() >= 3) {
|
||||
@ -417,7 +418,8 @@ bool ExtendedSysMon::updateSourceEvent(const QString &source)
|
||||
else if (source == QString("hddtemp")) {
|
||||
QStringList deviceList = configuration[QString("HDDDEV")].split(QChar(','), QString::SkipEmptyParts);
|
||||
for (int i=0; i<deviceList.count(); i++) {
|
||||
float value = getHddTemp(deviceList[i]);
|
||||
float value = getHddTemp(configuration[QString("HDDTEMPCMD")],
|
||||
deviceList[i]);
|
||||
setData(source, deviceList[i], value);
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
QString getCustomCmd(const QString cmd);
|
||||
float getGpu(const QString device);
|
||||
float getGpuTemp(const QString device);
|
||||
float getHddTemp(const QString device);
|
||||
float getHddTemp(const QString cmd, const QString device);
|
||||
QStringList getPlayerInfo(const QString playerName,
|
||||
const QString mpdAddress = 0,
|
||||
const QString mpdPort = 0);
|
||||
|
Loading…
Reference in New Issue
Block a user