mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 23:47:20 +00:00
added support of disable option to dataengine
This commit is contained in:
parent
1eed0f458c
commit
3d8f88d935
@ -1,8 +1,10 @@
|
||||
Ver.1.9.1:
|
||||
+ added ability for force update text
|
||||
+ added support of hddtemp cmd
|
||||
+ added support of clementine
|
||||
+ added tags $memtotmb, $memtotgb, $swaptotmb, $swaptotgb
|
||||
+ added ability for force update text
|
||||
+ added support of clementine
|
||||
+ added support of hddtemp cmd
|
||||
+ added support of disable option for HDDDEV and GPUDEV
|
||||
+ added error checking of DataEngine variables
|
||||
+ added Brazillian Portuguese translation (@underr)
|
||||
+ added Ukrainian translation (Виктор Слободян)
|
||||
* player settings was moved from plasmoid to dataengine
|
||||
|
@ -1,8 +1,10 @@
|
||||
Вер.1.9.1:
|
||||
+ добавлена возможность форсированного обновления
|
||||
+ добавлена поддержка команды hddtemp
|
||||
+ добавлена поддержка clementine
|
||||
+ добавлены теги $memtotmb, $memtotgb, $swaptotmb, $swaptotgb
|
||||
+ добавлена возможность форсированного обновления
|
||||
+ добавлена поддержка clementine
|
||||
+ добавлена поддержка команды hddtemp
|
||||
+ добавлены поддержка disable для HDDDEV и GPUDEV
|
||||
+ добавлена проверка ошибок для переменных DataEngine
|
||||
+ добавлен перевод Brazillian Portuguese (@underr)
|
||||
+ добавлена украинская локализация (Виктор Слободян)
|
||||
* настройки плеера были перенесены из виджета в dataengine
|
||||
|
@ -1,14 +1,14 @@
|
||||
# Configuration file for Extended Systemmonitor DataEngine
|
||||
# Uncomment needed lines
|
||||
# $kdehome/share/config/extsysmon.conf
|
||||
|
||||
# Custom command, separator is '@@'
|
||||
#CUSTOM=wget -qO- http://ifconfig.me/ip
|
||||
|
||||
# Set GPU device
|
||||
# May be 'nvidia' (for nvidia), 'ati' (for ATI RADEON), 'ignore' or 'auto'
|
||||
# May be 'nvidia' (for nvidia), 'ati' (for ATI RADEON), 'disable' or 'auto'
|
||||
#GPUDEV=auto
|
||||
|
||||
# Set block device for hddtemp comma separated or use 'all'
|
||||
# Set block device for hddtemp comma separated or use 'all' or 'disable'
|
||||
#HDDDEV=all
|
||||
|
||||
# Set MPD settings
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <KDE/KStandardDirs>
|
||||
#include <QFile>
|
||||
#include <QProcess>
|
||||
#include <QRegExp>
|
||||
#include <QTextCodec>
|
||||
|
||||
|
||||
@ -42,7 +43,7 @@ QString ExtendedSysMon::getAllHdd()
|
||||
QStringList devices;
|
||||
QString qoutput = QString("");
|
||||
QString dev;
|
||||
command.start("find /dev -name [hs]d[a-z]");
|
||||
command.start("find /dev -name [hms]d[a-z]");
|
||||
command.waitForFinished(-1);
|
||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(command.readAllStandardOutput());
|
||||
for (int i=0; i<qoutput.split(QChar('\n'), QString::SkipEmptyParts).count(); i++) {
|
||||
@ -56,7 +57,7 @@ QString ExtendedSysMon::getAllHdd()
|
||||
QString ExtendedSysMon::getAutoGpu()
|
||||
{
|
||||
QProcess command;
|
||||
QString gpu = QString("");
|
||||
QString gpu = QString("unknown");
|
||||
QString qoutput = QString("");
|
||||
command.start("lspci");
|
||||
command.waitForFinished(-1);
|
||||
@ -139,14 +140,39 @@ QMap<QString, QString> ExtendedSysMon::updateConfiguration(const QMap<QString, Q
|
||||
config[key] = value;
|
||||
}
|
||||
// update values
|
||||
if (config[QString("GPUDEV")] == QString("auto"))
|
||||
if (config[QString("GPUDEV")] == QString("disable"))
|
||||
config[QString("GPUDEV")] = QString("disable");
|
||||
else if (config[QString("GPUDEV")] == QString("auto"))
|
||||
config[QString("GPUDEV")] = getAutoGpu();
|
||||
else if ((config[QString("GPUDEV")] != QString("ati")) &&
|
||||
(config[QString("GPUDEV")] != QString("nvidia")))
|
||||
config[QString("GPUDEV")] = getAutoGpu();
|
||||
if (config[QString("HDDDEV")] == QString("all"))
|
||||
config[QString("HDDDEV")] = getAllHdd();
|
||||
else if (config[QString("HDDDEV")] == QString("disable"))
|
||||
config[QString("HDDDEV")] = QString("");
|
||||
else {
|
||||
QStringList deviceList = config[QString("HDDDEV")].split(QChar(','), QString::SkipEmptyParts);
|
||||
QStringList devices;
|
||||
QRegExp diskRegexp = QRegExp("/dev/[hms]d[a-z]$");
|
||||
for (int i=0; i<deviceList.count(); i++)
|
||||
if ((QFile::exists(deviceList[i])) &&
|
||||
(diskRegexp.indexIn(deviceList[i]) > -1))
|
||||
devices.append(deviceList[i]);
|
||||
if (devices.isEmpty())
|
||||
config[QString("HDDDEV")] = getAllHdd();
|
||||
else
|
||||
config[QString("HDDDEV")] = devices.join(QChar(','));
|
||||
}
|
||||
for (int i=config[QString("PKGNULL")].split(QString(","), QString::SkipEmptyParts).count();
|
||||
i<config[QString("PKGCMD")].split(QString(","), QString::SkipEmptyParts).count()+1;
|
||||
i++)
|
||||
config[QString("PKGNULL")] += QString(",0");
|
||||
if ((config[QString("PLAYER")] != QString("amarok")) &&
|
||||
(config[QString("PLAYER")] != QString("clementine")) &&
|
||||
(config[QString("PLAYER")] != QString("mpd")) &&
|
||||
(config[QString("PLAYER")] != QString("qmmp")))
|
||||
config[QString("PLAYER")] = QString("amarok");
|
||||
return config;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user