Compare commits

...

8 Commits

Author SHA1 Message Date
43ee40a65d release 1.10.2 2014-06-11 04:23:46 +04:00
f9eb27964f release 1.10.1 2014-06-10 10:44:34 +04:00
bab9f58b35 try again fix of initialization 2014-06-10 10:42:15 +04:00
608908fd02 fix checking of qmmp 2014-06-10 09:57:30 +04:00
178bbd0bc0 fix first initialization 2014-06-10 09:42:21 +04:00
f8a02a48ac fix 2014-06-10 09:30:31 +04:00
cf39fba9c2 fix error in ps dataengine 2014-06-10 09:27:26 +04:00
6643852822 edit desktop files 2014-06-10 07:59:05 +04:00
9 changed files with 73 additions and 31 deletions

View File

@ -1,3 +1,11 @@
Ver.1.10.2:
- fix error with tempUnits in hddtemp label
Ver.1.10.1:
- fix error with number formats in ps label
- fix first initialization of DataEngine
- fix checking of qmmp
Ver.1.10.0: Ver.1.10.0:
+ added tags $hddtotmb, $hddtotgb + added tags $hddtotmb, $hddtotgb
+ added tags $memtotmb, $memtotgb, $swaptotmb, $swaptotgb + added tags $memtotmb, $memtotgb, $swaptotmb, $swaptotgb

View File

@ -1,3 +1,11 @@
Вер.1.10.2:
- фикс ошибки с tempUnits в поле hddtemp
Вер.1.10.1:
- пофикшена ошибка с форматами чисел в поле ps
- пофикшена инициализация значений в DataEngine
- пофикшена проверка qmmp
Вер.1.10.0: Вер.1.10.0:
+ добавлены теги $hddtotmb, $hddtotgb + добавлены теги $hddtotmb, $hddtotgb
+ добавлены теги $memtotmb, $memtotgb, $swaptotmb, $swaptotgb + добавлены теги $memtotmb, $memtotgb, $swaptotmb, $swaptotgb

View File

@ -2,7 +2,7 @@
pkgname=kdeplasma-applets-pytextmonitor pkgname=kdeplasma-applets-pytextmonitor
_pkgname=pytextmonitor _pkgname=pytextmonitor
pkgver=1.10.0 pkgver=1.10.2
pkgrel=1 pkgrel=1
pkgdesc="Minimalistic Plasmoid script written on Python2. It looks like widgets in Awesome WM" pkgdesc="Minimalistic Plasmoid script written on Python2. It looks like widgets in Awesome WM"
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
@ -21,7 +21,7 @@ optdepends=("amarok: for music player monitor"
makedepends=('automoc4' 'cmake') makedepends=('automoc4' 'cmake')
source=(https://github.com/arcan1s/pytextmonitor/releases/download/V.${pkgver}/${_pkgname}-${pkgver}-src.tar.xz) source=(https://github.com/arcan1s/pytextmonitor/releases/download/V.${pkgver}/${_pkgname}-${pkgver}-src.tar.xz)
install=${pkgname}.install install=${pkgname}.install
md5sums=('68227097322e3949b61b7bd1c0963511') md5sums=('62b7cb57cb996282bb7decc2dbdf27c1')
backup=('usr/share/config/extsysmon.conf') backup=('usr/share/config/extsysmon.conf')
prepare() { prepare() {

View File

@ -8,7 +8,7 @@ cmake_policy (SET CMP0015 NEW)
project (pytextmonitor) project (pytextmonitor)
set (PROJECT_VERSION_MAJOR 1) set (PROJECT_VERSION_MAJOR 1)
set (PROJECT_VERSION_MINOR 10) set (PROJECT_VERSION_MINOR 10)
set (PROJECT_VERSION_PATCH 0) set (PROJECT_VERSION_PATCH 2)
set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}) set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
message (STATUS "Version: ${PROJECT_VERSION}") message (STATUS "Version: ${PROJECT_VERSION}")

View File

@ -26,6 +26,7 @@
#include <QProcessEnvironment> #include <QProcessEnvironment>
#include <QRegExp> #include <QRegExp>
#include <QTextCodec> #include <QTextCodec>
#include <QThread>
ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList& args) ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList& args)
@ -104,6 +105,15 @@ QStringList ExtendedSysMon::sources() const
} }
void ExtendedSysMon::initValues()
{
if (debug) qDebug() << "[DE]" << "[initValues]";
QStringList sourceList = sources();
for (int i=0; i<sourceList.count(); i++)
sourceRequestEvent(sourceList[i]);
}
void ExtendedSysMon::readConfiguration() void ExtendedSysMon::readConfiguration()
{ {
if (debug) qDebug() << "[DE]" << "[readConfiguration]"; if (debug) qDebug() << "[DE]" << "[readConfiguration]";
@ -197,6 +207,8 @@ void ExtendedSysMon::setKeys()
setData(source, key, QString("")); setData(source, key, QString(""));
key = QString("psTotal"); key = QString("psTotal");
setData(source, key, QString("0")); setData(source, key, QString("0"));
// initialization of values
initValues();
} }
@ -311,7 +323,9 @@ void ExtendedSysMon::getCustomCmd(const QString cmd, const int number)
if (debug) qDebug() << "[DE]" << "[getCustomCmd]" << ":" << "Run function with cmd" << cmd; if (debug) qDebug() << "[DE]" << "[getCustomCmd]" << ":" << "Run function with cmd" << cmd;
if (debug) qDebug() << "[DE]" << "[getCustomCmd]" << ":" << "Run function with number" << number; if (debug) qDebug() << "[DE]" << "[getCustomCmd]" << ":" << "Run function with number" << number;
if (debug) qDebug() << "[DE]" << "[getCustomCmd]" << ":" << "Run cmd" << QString("bash -c \"") + cmd + QString("\""); if (debug) qDebug() << "[DE]" << "[getCustomCmd]" << ":" << "Run cmd" << QString("bash -c \"") + cmd + QString("\"");
processes[QString("custom")][number]->start(QString("bash -c \"") + cmd + QString("\"")); if ((processes[QString("custom")][number]->state() != QProcess::Running) &&
(processes[QString("custom")][number]->state() != QProcess::Starting))
processes[QString("custom")][number]->start(QString("bash -c \"") + cmd + QString("\""));
} }
@ -347,7 +361,9 @@ void ExtendedSysMon::getGpu(const QString device)
else if (device == QString("ati")) else if (device == QString("ati"))
cmd = QString("aticonfig --od-getclocks"); cmd = QString("aticonfig --od-getclocks");
if (debug) qDebug() << "[DE]" << "[getGpu]" << ":" << "Run cmd" << cmd; if (debug) qDebug() << "[DE]" << "[getGpu]" << ":" << "Run cmd" << cmd;
processes[QString("gpu")][0]->start(cmd); if ((processes[QString("gpu")][0]->state() != QProcess::Running) &&
(processes[QString("gpu")][0]->state() != QProcess::Starting))
processes[QString("gpu")][0]->start(cmd);
} }
@ -400,7 +416,9 @@ void ExtendedSysMon::getGpuTemp(const QString device)
else if (device == QString("ati")) else if (device == QString("ati"))
cmd = QString("aticonfig --od-gettemperature"); cmd = QString("aticonfig --od-gettemperature");
if (debug) qDebug() << "[DE]" << "[getGpuTemp]" << ":" << "Run cmd" << cmd; if (debug) qDebug() << "[DE]" << "[getGpuTemp]" << ":" << "Run cmd" << cmd;
processes[QString("gputemp")][0]->start(cmd); if ((processes[QString("gputemp")][0]->state() != QProcess::Running) &&
(processes[QString("gputemp")][0]->state() != QProcess::Running))
processes[QString("gputemp")][0]->start(cmd);
} }
@ -446,7 +464,9 @@ void ExtendedSysMon::getHddTemp(const QString cmd, const QString device, const i
if (debug) qDebug() << "[DE]" << "[getHddTemp]" << ":" << "Run function with device" << device; if (debug) qDebug() << "[DE]" << "[getHddTemp]" << ":" << "Run function with device" << device;
if (debug) qDebug() << "[DE]" << "[getHddTemp]" << ":" << "Run function with number" << number; if (debug) qDebug() << "[DE]" << "[getHddTemp]" << ":" << "Run function with number" << number;
if (debug) qDebug() << "[DE]" << "[getHddTemp]" << ":" << "Run cmd" << cmd + QString(" ") + device; if (debug) qDebug() << "[DE]" << "[getHddTemp]" << ":" << "Run cmd" << cmd + QString(" ") + device;
processes[QString("hddtemp")][number]->start(cmd + QString(" ") + device); if ((processes[QString("hddtemp")][number]->state() != QProcess::Running) &&
(processes[QString("hddtemp")][number]->state() != QProcess::Starting))
processes[QString("hddtemp")][number]->start(cmd + QString(" ") + device);
} }
@ -483,31 +503,23 @@ void ExtendedSysMon::getPlayerInfo(const QString playerName,
if (debug) qDebug() << "[DE]" << "[getPlayerInfo]" << ":" << "Run function with MPD parameters" << if (debug) qDebug() << "[DE]" << "[getPlayerInfo]" << ":" << "Run function with MPD parameters" <<
mpdAddress + QString(":") + mpdPort; mpdAddress + QString(":") + mpdPort;
QString cmd; QString cmd;
if (playerName == QString("amarok")) { if (playerName == QString("amarok"))
// amarok // amarok
cmd = QString("bash -c \"qdbus org.kde.amarok /Player GetMetadata && qdbus org.kde.amarok /Player PositionGet\""); cmd = QString("bash -c \"qdbus org.kde.amarok /Player GetMetadata && qdbus org.kde.amarok /Player PositionGet\"");
if (debug) qDebug() << "[DE]" << "[getPlayerInfo]" << ":" << "Run cmd" << cmd; else if (playerName == QString("clementine"))
processes[QString("player")][0]->start(cmd);
}
else if (playerName == QString("clementine")) {
// clementine // clementine
cmd = QString("bash -c \"qdbus org.mpris.clementine /Player GetMetadata && qdbus org.mpris.clementine /Player PositionGet\""); cmd = QString("bash -c \"qdbus org.mpris.clementine /Player GetMetadata && qdbus org.mpris.clementine /Player PositionGet\"");
if (debug) qDebug() << "[DE]" << "[getPlayerInfo]" << ":" << "Run cmd" << cmd; else if (playerName == QString("mpd"))
processes[QString("player")][0]->start(cmd);
}
else if (playerName == QString("mpd")) {
// mpd // mpd
cmd = QString("bash -c \"echo 'currentsong\nstatus\nclose' | curl --connect-timeout 1 -fsm 3 telnet://") + cmd = QString("bash -c \"echo 'currentsong\nstatus\nclose' | curl --connect-timeout 1 -fsm 3 telnet://") +
mpdAddress + QString(":") + mpdPort + QString("\""); mpdAddress + QString(":") + mpdPort + QString("\"");
if (debug) qDebug() << "[DE]" << "[getPlayerInfo]" << ":" << "Run cmd" << cmd; else if (playerName == QString("qmmp"))
processes[QString("player")][0]->start(cmd);
}
else if (playerName == QString("qmmp")) {
// qmmp // qmmp
cmd = QString("qmmp --status"); cmd = QString("bash -c \"pgrep qmmp && qmmp --status || echo 'null'\"");
if (debug) qDebug() << "[DE]" << "[getPlayerInfo]" << ":" << "Run cmd" << cmd; if (debug) qDebug() << "[DE]" << "[getPlayerInfo]" << ":" << "Run cmd" << cmd;
if ((processes[QString("player")][0]->state() != QProcess::Running) &&
(processes[QString("player")][0]->state() != QProcess::Starting))
processes[QString("player")][0]->start(cmd); processes[QString("player")][0]->start(cmd);
}
} }
@ -635,10 +647,14 @@ void ExtendedSysMon::getPsStats()
QString cmd; QString cmd;
cmd = QString("ps --no-headers -o command"); cmd = QString("ps --no-headers -o command");
if (debug) qDebug() << "[DE]" << "[getPsStats]" << ":" << "Run cmd" << cmd; if (debug) qDebug() << "[DE]" << "[getPsStats]" << ":" << "Run cmd" << cmd;
processes[QString("ps")][0]->start(cmd); if ((processes[QString("ps")][0]->state() != QProcess::Running) &&
(processes[QString("ps")][0]->state() != QProcess::Starting))
processes[QString("ps")][0]->start(cmd);
cmd = QString("ps -e --no-headers -o command"); cmd = QString("ps -e --no-headers -o command");
if (debug) qDebug() << "[DE]" << "[getPsStats]" << ":" << "Run cmd" << cmd; if (debug) qDebug() << "[DE]" << "[getPsStats]" << ":" << "Run cmd" << cmd;
processes[QString("ps")][1]->start(cmd); if ((processes[QString("ps")][1]->state() != QProcess::Running) &&
(processes[QString("ps")][1]->state() != QProcess::Starting))
processes[QString("ps")][1]->start(cmd);
} }
@ -662,7 +678,7 @@ void ExtendedSysMon::setPs(int exitCode, QProcess::ExitStatus exitStatus)
psList.append(qoutput.split(QChar('\n'), QString::SkipEmptyParts)[i]); psList.append(qoutput.split(QChar('\n'), QString::SkipEmptyParts)[i]);
QString source = QString("ps"); QString source = QString("ps");
QString key = QString("psCount"); QString key = QString("psCount");
setData(source, key, QString::number(psList.count())); setData(source, key, psList.count());
key = QString("ps"); key = QString("ps");
setData(source, key, psList.join(QString(","))); setData(source, key, psList.join(QString(",")));
} }
@ -670,7 +686,7 @@ void ExtendedSysMon::setPs(int exitCode, QProcess::ExitStatus exitStatus)
// pstotal // pstotal
QString source = QString("ps"); QString source = QString("ps");
QString key = QString("psTotal"); QString key = QString("psTotal");
setData(source, key, QString::number(qoutput.split(QChar('\n'), QString::SkipEmptyParts).count())); setData(source, key, qoutput.split(QChar('\n'), QString::SkipEmptyParts).count());
} }
} }
} }
@ -684,7 +700,9 @@ void ExtendedSysMon::getUpgradeInfo(const QString pkgCommand, const int number)
if (debug) qDebug() << "[DE]" << "[getUpgradeInfo]" << ":" << "Run function with number" << number; if (debug) qDebug() << "[DE]" << "[getUpgradeInfo]" << ":" << "Run function with number" << number;
QString cmd = QString("bash -c \"") + pkgCommand + QString(" | wc -l\""); QString cmd = QString("bash -c \"") + pkgCommand + QString(" | wc -l\"");
if (debug) qDebug() << "[DE]" << "[getUpgradeInfo]" << ":" << "Run cmd" << cmd; if (debug) qDebug() << "[DE]" << "[getUpgradeInfo]" << ":" << "Run cmd" << cmd;
processes[QString("pkg")][number]->start(cmd); if ((processes[QString("pkg")][number]->state() != QProcess::Running) &&
(processes[QString("pkg")][number]->state() != QProcess::Starting))
processes[QString("pkg")][number]->start(cmd);
} }

View File

@ -64,6 +64,7 @@ private:
// reread configuration // reread configuration
QString getAllHdd(); QString getAllHdd();
QString getAutoGpu(); QString getAutoGpu();
void initValues();
void readConfiguration(); void readConfiguration();
void setKeys(); void setKeys();
void setProcesses(); void setProcesses();

View File

@ -1,7 +1,7 @@
[Desktop Entry] [Desktop Entry]
Encoding=UTF-8 Encoding=UTF-8
Name=Extended SystemMonitor DataEngine Name=Extended SystemMonitor DataEngine
Comment=Adds gpu, gputemp and hddtemp to DataEngine Comment=Adds some additional functions to System DataEngine
ServiceTypes=Plasma/DataEngine ServiceTypes=Plasma/DataEngine
Type=Service Type=Service
Icon=utilities-system-monitor Icon=utilities-system-monitor

View File

@ -510,7 +510,7 @@ class pyTextWidget(plasmascript.Applet):
for i in devices: for i in devices:
if (line.split('$hddtemp' + str(i))[0] != line): if (line.split('$hddtemp' + str(i))[0] != line):
line = line.split('$hddtemp' + str(i))[0] +\ line = line.split('$hddtemp' + str(i))[0] +\
getTemp(str(self.ptm['values']['hddtemp'][self.ptm['names']['hddtemp'][i]]), self.ptm['vars']['adv']['tempUnit']) +\ getTemp(str(self.ptm['values']['hddtemp'][self.ptm['names']['hddtemp'][i]]), self.ptm['vars']['adv']['tempUnits']) +\
line.split('$hddtemp' + str(i))[1] line.split('$hddtemp' + str(i))[1]
text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1] text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
self.setText("hddtemp", text) self.setText("hddtemp", text)

View File

@ -1,6 +1,13 @@
[Desktop Entry] [Desktop Entry]
Encoding=UTF-8 Encoding=UTF-8
Name=Py Text Monitor Name=Py Text Monitor
Comment=A minimalistic Plasmoid script written on Python2
Comment[en]=A minimalistic Plasmoid script written on Python2
Comment[es]=Un plasmoide minimalista escrito en Python2
Comment[es]=Un script Plasmoïde minimaliste écrit sur Python2
Comment[pt_BR]=Um script Plasmoid escrito em Python2
Comment[ru]=Минималистичный плазмоид скрипт, написанный на Python2
Comment[uk]=Мінімалістичний плазмоїд, що написаний на Python2
ServiceTypes=Plasma/Applet ServiceTypes=Plasma/Applet
Type=Service Type=Service
Icon=utilities-system-monitor Icon=utilities-system-monitor
@ -13,7 +20,7 @@ X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis
X-KDE-PluginInfo-Email=esalexeev@gmail.com X-KDE-PluginInfo-Email=esalexeev@gmail.com
X-KDE-PluginInfo-Name=pytextmonitor X-KDE-PluginInfo-Name=pytextmonitor
X-KDE-PluginInfo-Version=@PROJECT_VERSION@ X-KDE-PluginInfo-Version=@PROJECT_VERSION@
X-KDE-PluginInfo-Website=http://kde-look.org/ X-KDE-PluginInfo-Website=http://arcanis.name/projects/pytextmonitor/
X-KDE-PluginInfo-Category=System Information X-KDE-PluginInfo-Category=System Information
X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPLv3 X-KDE-PluginInfo-License=GPLv3