mirror of
				https://github.com/arcan1s/awesome-widgets.git
				synced 2025-10-30 21:03:41 +00:00 
			
		
		
		
	refactoring of de
This commit is contained in:
		| @ -23,350 +23,383 @@ | ||||
| #include <QProcess> | ||||
| #include <QTextCodec> | ||||
|  | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
| #include <QDebug> | ||||
|  | ||||
|  | ||||
| ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList& args) | ||||
|   : Plasma::DataEngine(parent, args) | ||||
|     : Plasma::DataEngine(parent, args) | ||||
| { | ||||
|   Q_UNUSED(args) | ||||
|     Q_UNUSED(args) | ||||
|  | ||||
|   setMinimumPollingInterval(333); | ||||
|   readConfiguration(); | ||||
|     setMinimumPollingInterval(333); | ||||
|     readConfiguration(); | ||||
| } | ||||
|  | ||||
|  | ||||
| QString ExtendedSysMon::getAllHdd() | ||||
| { | ||||
|     QProcess command; | ||||
|     QStringList devices; | ||||
|     QString qoutput = QString(""); | ||||
|     QString dev; | ||||
|     command.start("find /dev -name [hs]d[a-z]"); | ||||
|     command.waitForFinished(-1); | ||||
|     qoutput = QTextCodec::codecForMib(106)->toUnicode(command.readAllStandardOutput()); | ||||
|     for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) { | ||||
|         dev = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i]; | ||||
|         devices.append(dev); | ||||
|     } | ||||
|     return devices.join(QChar(',')); | ||||
| } | ||||
|  | ||||
|  | ||||
| QString ExtendedSysMon::getAutoGpu() | ||||
| { | ||||
|     QProcess command; | ||||
|     QString gpu = QString(""); | ||||
|     QString qoutput = QString(""); | ||||
|     command.start("lspci"); | ||||
|     command.waitForFinished(-1); | ||||
|     qoutput = QTextCodec::codecForMib(106)->toUnicode(command.readAllStandardOutput()); | ||||
|     if (qoutput.toLower().contains("nvidia")) | ||||
|         gpu = QString("nvidia"); | ||||
|     else if (qoutput.toLower().contains("radeon")) | ||||
|         gpu = QString("ati"); | ||||
|     return gpu; | ||||
| } | ||||
|  | ||||
|  | ||||
| QStringList ExtendedSysMon::sources() const | ||||
| { | ||||
|   QStringList source; | ||||
|   source.append(QString("gpu")); | ||||
|   source.append(QString("gputemp")); | ||||
|   source.append(QString("hddtemp")); | ||||
|   source.append(QString("player")); | ||||
|   source.append(QString("custom")); | ||||
|   return source; | ||||
|     QStringList source; | ||||
|     source.append(QString("gpu")); | ||||
|     source.append(QString("gputemp")); | ||||
|     source.append(QString("hddtemp")); | ||||
|     source.append(QString("pkg")); | ||||
|     source.append(QString("player")); | ||||
|     source.append(QString("ps")); | ||||
|     source.append(QString("custom")); | ||||
|     return source; | ||||
| } | ||||
|  | ||||
|  | ||||
| bool ExtendedSysMon::readConfiguration() | ||||
| { | ||||
|   // pre-setup | ||||
|   FILE *f_out; | ||||
|   f_out = popen("lspci 2> /dev/null", "r"); | ||||
|   char device[256]; | ||||
|   QString dev; | ||||
|   while (fgets(device, 256, f_out) != NULL) { | ||||
|     dev = QString(device); | ||||
|     if (dev.toLower().contains("nvidia")) | ||||
|       gpuDev = QString("nvidia"); | ||||
|     else if (dev.toLower().contains("radeon")) | ||||
|       gpuDev = QString("ati"); | ||||
|   } | ||||
|   pclose(f_out); | ||||
|    | ||||
|   f_out = popen("ls -1 /dev/sd[a-z] 2> /dev/null ; ls -1 /dev/hd[a-z] 2> /dev/null", "r"); | ||||
|   while (fgets(device, 256, f_out) != NULL) { | ||||
|     dev = QString(device).split("\n")[0]; | ||||
|     if (dev[0] == '/') | ||||
|       hddDev.append(dev); | ||||
|   } | ||||
|   pclose(f_out); | ||||
|    | ||||
|   mpdAddress = QString("localhost"); | ||||
|   mpdPort = QString("6600"); | ||||
|    | ||||
|   customCommand = QString("wget -qO- http://ifconfig.me/ip"); | ||||
|    | ||||
|   QString fileStr; | ||||
|   // FIXME: define configuration file | ||||
|   QString confFileName = QString(getenv("HOME")) + QString("/.kde4/share/config/extsysmon.conf"); | ||||
|   QFile confFile(confFileName); | ||||
|   bool exists = confFile.open(QIODevice::ReadOnly); | ||||
|   if (!exists) { | ||||
|     confFileName = QString("/usr/share/config/extsysmon.conf"); | ||||
|     confFile.setFileName(confFileName); | ||||
|     exists = confFile.open(QIODevice::ReadOnly); | ||||
|     if (!exists) | ||||
|       return false; | ||||
|   } | ||||
|    | ||||
|   while (true) { | ||||
|     fileStr = QString(confFile.readLine()); | ||||
|     if (fileStr[0] != '#') { | ||||
|       if (fileStr.split(QString("="), QString::SkipEmptyParts).count() == 2) { | ||||
|         if (fileStr.split(QString("="), QString::SkipEmptyParts)[0] == QString("GPUDEV")) { | ||||
|           if (fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed() == QString("ati")) | ||||
|             gpuDev = fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed(); | ||||
|           else if (fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed() == QString("nvidia")) | ||||
|             gpuDev = fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed(); | ||||
|           else if (fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed() != QString("auto")) | ||||
|             gpuDev = QString("ignore"); | ||||
|         } | ||||
|         else if (fileStr.split(QString("="), QString::SkipEmptyParts)[0] == QString("HDDDEV")) { | ||||
|           if (fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed() != QString("all")) { | ||||
|             hddDev.clear(); | ||||
|             for (int i=0; i<fileStr.split(QString("="), QString::SkipEmptyParts)[1].split(QString("\n"), \ | ||||
|                             QString::SkipEmptyParts)[0].split(QString(","), QString::SkipEmptyParts).count(); i++) | ||||
|               hddDev.append(fileStr.split(QString("="), QString::SkipEmptyParts)[1].split(QString("\n"), \ | ||||
|                             QString::SkipEmptyParts)[0].split(QString(","), QString::SkipEmptyParts)[i]); | ||||
|           } | ||||
|         } | ||||
|         else if (fileStr.split(QString("="), QString::SkipEmptyParts)[0] == QString("MPDADDRESS")) | ||||
|           mpdAddress = fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed(); | ||||
|         else if (fileStr.split(QString("="), QString::SkipEmptyParts)[0] == QString("MPDPORT")) | ||||
|           mpdPort = fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed(); | ||||
|        else if (fileStr.split(QString("="), QString::SkipEmptyParts)[0] == QString("CUSTOM")) | ||||
|           customCommand = fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed(); | ||||
|       } | ||||
|     // pre-setup | ||||
|     configuration[QString("GPUDEV")] = QString("auto"); | ||||
|     configuration[QString("HDDDEV")] = QString("all"); | ||||
|     configuration[QString("MPDADDRESS")] = QString("localhost"); | ||||
|     configuration[QString("MPDPORT")] = QString("6600"); | ||||
|     configuration[QString("CUSTOM")] = QString("wget -qO- http://ifconfig.me/ip"); | ||||
|     configuration[QString("PKGCMD")] = QString("pacman -Qu"); | ||||
|  | ||||
|     QString fileStr; | ||||
|     // FIXME: define configuration file | ||||
|     QFile confFile(QString(getenv("HOME")) + QString("/.kde4/share/config/extsysmon.conf")); | ||||
|     bool exists = confFile.open(QIODevice::ReadOnly); | ||||
|     if (!exists) { | ||||
|         confFile.setFileName("/usr/share/config/extsysmon.conf"); | ||||
|         exists = confFile.open(QIODevice::ReadOnly); | ||||
|         if (!exists) | ||||
|             return false; | ||||
|     } | ||||
|     if (confFile.atEnd()) | ||||
|       break; | ||||
|   } | ||||
|    | ||||
|   confFile.close(); | ||||
|   return true; | ||||
|     while (true) { | ||||
|         fileStr = QString(confFile.readLine()).trimmed(); | ||||
|         if (fileStr[0] != '#') { | ||||
|             if (fileStr.contains(QString("="))) | ||||
|                 configuration[fileStr.split(QString("="))[0]] = fileStr.split(QString("="))[1]; | ||||
|         } | ||||
|         if (confFile.atEnd()) | ||||
|             break; | ||||
|     } | ||||
|     confFile.close(); | ||||
|  | ||||
|     if (configuration[QString("GPUDEV")] == QString("auto")) | ||||
|         configuration[QString("GPUDEV")] = getAutoGpu(); | ||||
|     if (configuration[QString("HDDDEV")] == QString("all")) | ||||
|         configuration[QString("HDDDEV")] = getAllHdd(); | ||||
|  | ||||
|     return true; | ||||
| } | ||||
|  | ||||
|  | ||||
| QString ExtendedSysMon::getCustomCmd(const QString cmd) | ||||
| { | ||||
|     QProcess command; | ||||
|     QString qoutput = QString(""); | ||||
|     command.start(QString("bash -c \"") + cmd + QString("\"")); | ||||
|     command.waitForFinished(-1); | ||||
|     qoutput = QTextCodec::codecForMib(106)->toUnicode(command.readAllStandardOutput()).trimmed(); | ||||
|     return qoutput; | ||||
| } | ||||
|  | ||||
|  | ||||
| float ExtendedSysMon::getGpu(const QString device) | ||||
| { | ||||
|     float gpu = 0.0; | ||||
|     if ((device != QString("nvidia")) && (device != QString("ati"))) | ||||
|         return gpu; | ||||
|     QProcess command; | ||||
|     QString qoutput; | ||||
|  | ||||
|     if (device == QString("nvidia")) { | ||||
|         command.start(QString("nvidia-smi -q -d UTILIZATION")); | ||||
|         command.waitForFinished(-1); | ||||
|         qoutput = QTextCodec::codecForMib(106)->toUnicode(command.readAllStandardOutput()); | ||||
|         for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) { | ||||
|             if (qoutput.split(QString("\n"), QString::SkipEmptyParts)[i].contains(QString("Gpu"))) { | ||||
|                 QString load = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i] | ||||
|                         .split(QChar(' '), QString::SkipEmptyParts)[2] | ||||
|                         .remove(QChar('%')); | ||||
|                 gpu = load.toFloat(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|     else if (device == QString("ati")) { | ||||
|         command.start(QString("aticonfig --od-getclocks")); | ||||
|         command.waitForFinished(-1); | ||||
|         qoutput = QTextCodec::codecForMib(106)->toUnicode(command.readAllStandardOutput()); | ||||
|         for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) { | ||||
|             if (qoutput.split(QString("\n"), QString::SkipEmptyParts)[i].contains(QString("load"))) { | ||||
|                 QString load = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i] | ||||
|                         .split(QChar(' '), QString::SkipEmptyParts)[3] | ||||
|                         .remove(QChar('%')); | ||||
|                 gpu = load.toFloat(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|     return gpu; | ||||
| } | ||||
|  | ||||
|  | ||||
| float ExtendedSysMon::getGpuTemp(const QString device) | ||||
| { | ||||
|     float gpuTemp = 0.0; | ||||
|     if ((device != QString("nvidia")) && (device != QString("ati"))) | ||||
|         return gpuTemp; | ||||
|     QProcess command; | ||||
|     QString qoutput; | ||||
|     if (device == QString("nvidia")) { | ||||
|         command.start(QString("nvidia-smi -q -d TEMPERATURE")); | ||||
|         command.waitForFinished(-1); | ||||
|         qoutput = QTextCodec::codecForMib(106)->toUnicode(command.readAllStandardOutput()); | ||||
|         for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) { | ||||
|             if (qoutput.split(QString("\n"), QString::SkipEmptyParts)[i].contains(QString("Gpu"))) { | ||||
|                 QString temp = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i] | ||||
|                         .split(QChar(' '), QString::SkipEmptyParts)[2]; | ||||
|                 gpuTemp = temp.toFloat(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|     else if (device == QString("ati")) { | ||||
|         command.start(QString("aticonfig --od-gettemperature")); | ||||
|         command.waitForFinished(-1); | ||||
|         qoutput = QTextCodec::codecForMib(106)->toUnicode(command.readAllStandardOutput()); | ||||
|         for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) { | ||||
|             if (qoutput.split(QString("\n"), QString::SkipEmptyParts)[i].contains(QString("Temperature"))) { | ||||
|                 QString temp = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i] | ||||
|                         .split(QChar(' '), QString::SkipEmptyParts)[4]; | ||||
|                 gpuTemp = temp.toFloat(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|     return gpuTemp; | ||||
| } | ||||
|  | ||||
|  | ||||
| float ExtendedSysMon::getHddTemp(const QString device) | ||||
| { | ||||
|     float hddTemp = 0.0; | ||||
|     QProcess command; | ||||
|     QString qoutput = QString(""); | ||||
|     command.start(QString("sudo hddtemp ") + device); | ||||
|     command.waitForFinished(-1); | ||||
|     qoutput = QTextCodec::codecForMib(106)->toUnicode(command.readAllStandardOutput()).trimmed(); | ||||
|     if (qoutput.split(QChar(':'), QString::SkipEmptyParts).count() >= 3) { | ||||
|         QString temp = qoutput.split(QChar(':'), QString::SkipEmptyParts)[2]; | ||||
|         temp.remove(QChar(0260)).remove(QChar('C')); | ||||
|         hddTemp = temp.toFloat(); | ||||
|     } | ||||
|     return hddTemp; | ||||
| } | ||||
|  | ||||
|  | ||||
| QStringList ExtendedSysMon::getPlayerInfo(const QString playerName, | ||||
|                                           const QString mpdAddress, | ||||
|                                           const QString mpdPort) | ||||
| { | ||||
|     QStringList info; | ||||
|     // album | ||||
|     info.append(QString("unknown")); | ||||
|     // artist | ||||
|     info.append(QString("unknown")); | ||||
|     // progress | ||||
|     info.append(QString("0")); | ||||
|     // duration | ||||
|     info.append(QString("0")); | ||||
|     // title | ||||
|     info.append(QString("unknown")); | ||||
|     if ((playerName != QString("amarok")) || | ||||
|             (playerName != QString("mpd")) || | ||||
|             (playerName != QString("qmmp"))) | ||||
|         return info; | ||||
|     QProcess command; | ||||
|     QString qoutput = QString(""); | ||||
|     QString qstr; | ||||
|     if (playerName == QString("amarok")) { | ||||
|         // amarok | ||||
|         command.start("qdbus org.kde.amarok /Player GetMetadata"); | ||||
|         command.waitForFinished(-1); | ||||
|         qoutput = QTextCodec::codecForMib(106)->toUnicode(command.readAllStandardOutput()); | ||||
|         for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) { | ||||
|             qstr = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i]; | ||||
|             if (qstr.split(QString(": "), QString::SkipEmptyParts).count() > 1) { | ||||
|                 if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("album")) | ||||
|                     info[0] = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|                 else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("artist")) | ||||
|                     info[1] = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|                 else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("time")) | ||||
|                     info[3] = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|                 else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("title")) | ||||
|                     info[4] = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|             } | ||||
|         } | ||||
|         command.start("qdbus org.kde.amarok /Player PositionGet"); | ||||
|         command.waitForFinished(-1); | ||||
|         qoutput = QTextCodec::codecForMib(106)->toUnicode(command.readAllStandardOutput()); | ||||
|         for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) { | ||||
|             qstr = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i]; | ||||
|             int time = qstr.toInt() / 1000; | ||||
|             info[2] = QString::number(time); | ||||
|         } | ||||
|     } | ||||
|     else if (playerName == QString("mpd")) { | ||||
|         // mpd | ||||
|         command.start(QString("bash -c \"echo 'currentsong\nstatus\nclose' | curl --connect-timeout 1 -fsm 3 telnet://") + | ||||
|                       mpdAddress + QString(":") + mpdPort); | ||||
|         command.waitForFinished(-1); | ||||
|         qoutput = QTextCodec::codecForMib(106)->toUnicode(command.readAllStandardOutput()); | ||||
|         for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) { | ||||
|             qstr = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i]; | ||||
|             if (qstr.split(QString(": "), QString::SkipEmptyParts).count() > 1) { | ||||
|                 if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("Album")) | ||||
|                     info[0] = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|                 else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("Artist")) | ||||
|                     info[1] = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|                 else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("time")) { | ||||
|                     info[3] = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed().split(QString(":"))[0]; | ||||
|                     info[2] = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed().split(QString(":"))[1]; | ||||
|                 } | ||||
|                 else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("Title")) | ||||
|                     info[4] = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|     else if (playerName == QString("qmmp")) { | ||||
|         // qmmp | ||||
|         command.start("qmmp --status"); | ||||
|         command.waitForFinished(-1); | ||||
|         qoutput = QTextCodec::codecForMib(106)->toUnicode(command.readAllStandardOutput()); | ||||
|         for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) { | ||||
|             qstr = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i]; | ||||
|             if ((qstr.split(QString(" = "), QString::SkipEmptyParts).count() > 1) || (qstr.at(0) == QChar('['))) { | ||||
|                 if (qstr.split(QString(" = "), QString::SkipEmptyParts)[0] == QString("ALBUM")) | ||||
|                     info[0] = qstr.split(QString(" = "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|                 else if (qstr.split(QString(" = "), QString::SkipEmptyParts)[0] == QString("ARTIST")) | ||||
|                     info[1] = qstr.split(QString(" = "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|                 else if ((qstr.at(0) == QChar('[')) && (!qstr.contains("[stopped]"))) { | ||||
|                     QString time = qstr.split(QString(" "), QString::SkipEmptyParts)[2].trimmed(); | ||||
|                     info[2] = QString::number(time.split(QString("/"), QString::SkipEmptyParts)[0].split(QString(":"), QString::SkipEmptyParts)[0].toInt() * 60 + | ||||
|                             time.split(QString("/"), QString::SkipEmptyParts)[0].split(QString(":"), QString::SkipEmptyParts)[1].toInt()); | ||||
|                     info[3] = QString::number(time.split(QString("/"), QString::SkipEmptyParts)[1].split(QString(":"), QString::SkipEmptyParts)[0].toInt() * 60 + | ||||
|                             time.split(QString("/"), QString::SkipEmptyParts)[1].split(QString(":"), QString::SkipEmptyParts)[1].toInt()); | ||||
|                 } | ||||
|                 else if (qstr.split(QString(" = "), QString::SkipEmptyParts)[0] == QString("TITLE")) | ||||
|                     info[4] = qstr.split(QString(" = "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|     return info; | ||||
| } | ||||
|  | ||||
|  | ||||
| bool ExtendedSysMon::sourceRequestEvent(const QString &name) | ||||
| { | ||||
|   return updateSourceEvent(name); | ||||
|     return updateSourceEvent(name); | ||||
| } | ||||
|  | ||||
|  | ||||
| bool ExtendedSysMon::updateSourceEvent(const QString &source) | ||||
| { | ||||
|   FILE *f_out; | ||||
|   QString key, out, tmp_out, value; | ||||
|   bool ok = false; | ||||
|   char output[256], val[5]; | ||||
|   if (source == QString("gpu")) { | ||||
|     key = QString("GPU"); | ||||
|     if (gpuDev == QString("nvidia")) { | ||||
|       f_out = popen("nvidia-smi -q -d UTILIZATION 2> /dev/null | grep Gpu | tail -n1", "r"); | ||||
|       fgets (output, 256, f_out); | ||||
|       if ((output[0] == '\0') || | ||||
|           (QString(output).split(QString(" "), QString::SkipEmptyParts).count() < 2)) | ||||
|         value = QString("  N\\A"); | ||||
|       else { | ||||
|         out = QString(output).split(QString(" "), QString::SkipEmptyParts)[2]; | ||||
|         sprintf (val, "%5.1f", out.left(out.count()-2).toFloat(&ok)); | ||||
|         value = QString(val); | ||||
|       } | ||||
|       pclose(f_out); | ||||
|     QString key; | ||||
|     if (source == QString("gpu")) { | ||||
|         key = QString("GPU"); | ||||
|         float value = getGpu(configuration[QString("GPUDEV")]); | ||||
|         setData(source, key, value); | ||||
|     } | ||||
|     else if (gpuDev == QString("ati")) { | ||||
|       f_out = popen("aticonfig --od-getclocks 2> /dev/null | grep load | tail -n1", "r"); | ||||
|       fgets (output, 256, f_out); | ||||
|       if ((output[0] == '\0') || | ||||
|           (QString(output).split(QString(" "), QString::SkipEmptyParts).count() < 3)) | ||||
|         value = QString("  N\\A"); | ||||
|       else { | ||||
|         out = QString(output).split(QString(" "), QString::SkipEmptyParts)[3]; | ||||
|         sprintf (val, "%5.1f", out.left(out.count()-2).toFloat(&ok)); | ||||
|         value = QString(val); | ||||
|       } | ||||
|       pclose(f_out); | ||||
|     else if (source == QString("gputemp")) { | ||||
|         key = QString("GPUTemp"); | ||||
|         float value = getGpuTemp(configuration[QString("GPUDEV")]); | ||||
|         setData(source, key, value); | ||||
|     } | ||||
|     else { | ||||
|       value = QString("  N\\A"); | ||||
|     } | ||||
|     if (ok == false) | ||||
|       value = QString("  N\\A"); | ||||
|     value = value.split(QString(","), QString::SkipEmptyParts).join(QString(".")); | ||||
|     setData(source, key, value); | ||||
|   } | ||||
|   else if (source == QString("gputemp")) { | ||||
|     key = QString("GPUTemp"); | ||||
|     if (gpuDev == QString("nvidia")) { | ||||
|       f_out = popen("nvidia-smi -q -d TEMPERATURE 2> /dev/null | grep Gpu | tail -n1", "r"); | ||||
|       fgets (output, 256, f_out); | ||||
|       if ((output[0] == '\0') || | ||||
|           (QString(output).split(QString(" "), QString::SkipEmptyParts).count() < 2)) | ||||
|         value = QString(" N\\A"); | ||||
|       else { | ||||
|         out = QString(output).split(QString(" "), QString::SkipEmptyParts)[2]; | ||||
|         sprintf (val, "%4.1f", out.toFloat(&ok)); | ||||
|         value = QString(val); | ||||
|       } | ||||
|       pclose(f_out); | ||||
|     } | ||||
|     else if (gpuDev == QString("ati")) { | ||||
|       f_out = popen("aticonfig --od-gettemperature 2> /dev/null | grep Temperature | tail -n1", "r"); | ||||
|       fgets (output, 256, f_out); | ||||
|       if ((output[0] == '\0') || | ||||
|           (QString(output).split(QString(" "), QString::SkipEmptyParts).count() < 4)) | ||||
|         value = QString(" N\\A"); | ||||
|       else { | ||||
|         out = QString(output).split(QString(" "), QString::SkipEmptyParts)[4]; | ||||
|         sprintf (val, "%4.1f", out.toFloat(&ok)); | ||||
|         value = QString(val); | ||||
|       } | ||||
|       pclose(f_out); | ||||
|     } | ||||
|     else { | ||||
|       value = QString(" N\\A"); | ||||
|     } | ||||
|     if (ok == false) | ||||
|       value = QString(" N\\A"); | ||||
|     value = value.split(QString(","), QString::SkipEmptyParts).join(QString(".")); | ||||
|     setData(source, key, value); | ||||
|   } | ||||
|   else if (source == QString("hddtemp")) { | ||||
|     char command[256], *dev; | ||||
|     QByteArray qb; | ||||
|     for (int i=0; i<hddDev.count(); i++) { | ||||
|       qb = hddDev[i].toUtf8(); | ||||
|       dev = qb.data(); | ||||
|       sprintf(command, "sudo hddtemp %s 2> /dev/null", dev); | ||||
|       f_out = popen(command, "r"); | ||||
|       fgets(output, 256, f_out); | ||||
|       if ((output[0] == '\0') || | ||||
|           (QString(output).split(QString(":"), QString::SkipEmptyParts).count() < 3)) | ||||
|         value = QString(" N\\A"); | ||||
|       else { | ||||
|         out = QString(output).split(QString(":"), QString::SkipEmptyParts)[2]; | ||||
|         sprintf (val, "%4.1f", out.left(out.count()-4).toFloat(&ok)); | ||||
|         value = QString(val); | ||||
|       } | ||||
|       pclose(f_out); | ||||
|       if (ok == false) | ||||
|         value = QString(" N\\A"); | ||||
|       value = value.split(QString(","), QString::SkipEmptyParts).join(QString(".")); | ||||
|       setData(source, hddDev[i], value); | ||||
|     } | ||||
|   } | ||||
|   else if (source == QString("player")) { | ||||
|     QProcess player; | ||||
|     QString qoutput; | ||||
|     QString value_album, value_artist, value_progress, value_duration, qstr; | ||||
|     // qmmp | ||||
|     qoutput = QString(""); | ||||
|     value = QString("N\\A"); | ||||
|     value_album = QString("N\\A"); | ||||
|     value_artist = QString("N\\A"); | ||||
|     value_progress = QString("0"); | ||||
|     value_duration = QString("0"); | ||||
|     player.start("qmmp --status"); | ||||
|     player.waitForFinished(-1); | ||||
|     qoutput = QTextCodec::codecForMib(106)->toUnicode(player.readAllStandardOutput()); | ||||
|     for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) { | ||||
|       qstr = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i]; | ||||
|       if ((qstr.split(QString(" = "), QString::SkipEmptyParts).count() > 1) || (qstr.at(0) == QChar('['))) { | ||||
|         if (qstr.split(QString(" = "), QString::SkipEmptyParts)[0] == QString("ALBUM")) | ||||
|           value_album = qstr.split(QString(" = "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|         else if (qstr.split(QString(" = "), QString::SkipEmptyParts)[0] == QString("ARTIST")) | ||||
|           value_artist = qstr.split(QString(" = "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|         else if ((qstr.at(0) == QChar('[')) && (!qstr.contains("[stopped]"))) { | ||||
|           QString time = qstr.split(QString(" "), QString::SkipEmptyParts)[2].trimmed(); | ||||
|           value_progress = QString::number(time.split(QString("/"), QString::SkipEmptyParts)[0].split(QString(":"), QString::SkipEmptyParts)[0].toInt() * 60 + | ||||
|                                           time.split(QString("/"), QString::SkipEmptyParts)[0].split(QString(":"), QString::SkipEmptyParts)[1].toInt()); | ||||
|           value_duration = QString::number(time.split(QString("/"), QString::SkipEmptyParts)[1].split(QString(":"), QString::SkipEmptyParts)[0].toInt() * 60 + | ||||
|                                           time.split(QString("/"), QString::SkipEmptyParts)[1].split(QString(":"), QString::SkipEmptyParts)[1].toInt()); | ||||
|     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]); | ||||
|             setData(source, deviceList[i], value); | ||||
|         } | ||||
|         else if (qstr.split(QString(" = "), QString::SkipEmptyParts)[0] == QString("TITLE")) | ||||
|           value = qstr.split(QString(" = "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|       } | ||||
|     } | ||||
|     key = QString("qmmp_album"); | ||||
|     setData(source, key, value_album); | ||||
|     key = QString("qmmp_artist"); | ||||
|     setData(source, key, value_artist); | ||||
|     key = QString("qmmp_progress"); | ||||
|     setData(source, key, value_progress); | ||||
|     key = QString("qmmp_duration"); | ||||
|     setData(source, key, value_duration); | ||||
|     key = QString("qmmp_title"); | ||||
|     setData(source, key, value); | ||||
|     // amarok | ||||
|     qoutput = QString(""); | ||||
|     value = QString("N\\A"); | ||||
|     value_album = QString("N\\A"); | ||||
|     value_artist = QString("N\\A"); | ||||
|     value_progress = QString("0"); | ||||
|     value_duration = QString("0"); | ||||
|     player.start("qdbus org.kde.amarok /Player GetMetadata"); | ||||
|     player.waitForFinished(-1); | ||||
|     qoutput = QTextCodec::codecForMib(106)->toUnicode(player.readAllStandardOutput()); | ||||
|     for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) { | ||||
|       qstr = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i]; | ||||
|       if (qstr.split(QString(": "), QString::SkipEmptyParts).count() > 1) { | ||||
|         if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("album")) | ||||
|           value_album = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|         else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("artist")) | ||||
|           value_artist = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|         else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("time")) | ||||
|           value_duration = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|         else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("title")) | ||||
|           value = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|       } | ||||
|     else if (source == QString("player")) { | ||||
|         QStringList value; | ||||
|         // amarok | ||||
|         value = getPlayerInfo(QString("amarok")); | ||||
|         key = QString("amarok_album"); | ||||
|         setData(source, key, value[0]); | ||||
|         key = QString("amarok_artist"); | ||||
|         setData(source, key, value[1]); | ||||
|         key = QString("amarok_progress"); | ||||
|         setData(source, key, value[2]); | ||||
|         key = QString("amarok_duration"); | ||||
|         setData(source, key, value[3]); | ||||
|         key = QString("amarok_title"); | ||||
|         setData(source, key, value[4]); | ||||
|         // mpd | ||||
|         value = getPlayerInfo(QString("mpd"), | ||||
|                               configuration[QString("MPDADDRESS")], | ||||
|                               configuration[QString("MPDPORT")]); | ||||
|         key = QString("mpd_album"); | ||||
|         setData(source, key, value[0]); | ||||
|         key = QString("mpd_artist"); | ||||
|         setData(source, key, value[1]); | ||||
|         key = QString("mpd_progress"); | ||||
|         setData(source, key, value[2]); | ||||
|         key = QString("mpd_duration"); | ||||
|         setData(source, key, value[3]); | ||||
|         key = QString("mpd_title"); | ||||
|         setData(source, key, value[4]); | ||||
|         // qmmp | ||||
|         value = getPlayerInfo(QString("qmmp")); | ||||
|         key = QString("qmmp_album"); | ||||
|         setData(source, key, value[0]); | ||||
|         key = QString("qmmp_artist"); | ||||
|         setData(source, key, value[1]); | ||||
|         key = QString("qmmp_progress"); | ||||
|         setData(source, key, value[2]); | ||||
|         key = QString("qmmp_duration"); | ||||
|         setData(source, key, value[3]); | ||||
|         key = QString("qmmp_title"); | ||||
|         setData(source, key, value[4]); | ||||
|     } | ||||
|     player.start("qdbus org.kde.amarok /Player PositionGet"); | ||||
|     player.waitForFinished(-1); | ||||
|     qoutput = player.readAllStandardOutput(); | ||||
|     for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) { | ||||
|       qstr = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i]; | ||||
|       int time = qstr.toInt() / 1000; | ||||
|       value_progress = QString::number(time); | ||||
|     else if (source == QString("custom")) { | ||||
|         key = QString("custom"); | ||||
|         QString value = getCustomCmd(configuration[QString("CUSTOM")]); | ||||
|         setData(source, key, value); | ||||
|     } | ||||
|     key = QString("amarok_album"); | ||||
|     setData(source, key, value_album); | ||||
|     key = QString("amarok_artist"); | ||||
|     setData(source, key, value_artist); | ||||
|     key = QString("amarok_progress"); | ||||
|     setData(source, key, value_progress); | ||||
|     key = QString("amarok_duration"); | ||||
|     setData(source, key, value_duration); | ||||
|     key = QString("amarok_title"); | ||||
|     setData(source, key, value); | ||||
|     // mpd | ||||
|     value = QString("N\\A"); | ||||
|     value_album = QString("N\\A"); | ||||
|     value_artist = QString("N\\A"); | ||||
|     value_progress = QString("0"); | ||||
|     value_duration = QString("0"); | ||||
|     char commandStr[512]; | ||||
|     sprintf(commandStr, "bash -c \"echo 'currentsong\nstatus\nclose' | curl --connect-timeout 1 -fsm 3 telnet://%s:%s 2> /dev/null\"", \ | ||||
|             mpdAddress.toUtf8().data(), mpdPort.toUtf8().data()); | ||||
|     qoutput = QString(""); | ||||
|     player.start(QString(commandStr)); | ||||
|     player.waitForFinished(-1); | ||||
|     qoutput = QTextCodec::codecForMib(106)->toUnicode(player.readAllStandardOutput()); | ||||
|     for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) { | ||||
|       qstr = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i]; | ||||
|       if (qstr.split(QString(": "), QString::SkipEmptyParts).count() > 1) { | ||||
|         if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("Album")) | ||||
|           value_album = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|         else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("Artist")) | ||||
|           value_artist = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|         else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("time")) { | ||||
|           value_duration = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed().split(QString(":"))[0]; | ||||
|           value_progress = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed().split(QString(":"))[1]; | ||||
|         } | ||||
|         else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("Title")) | ||||
|           value = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed(); | ||||
|       } | ||||
|     } | ||||
|     key = QString("mpd_album"); | ||||
|     setData(source, key, value_album); | ||||
|     key = QString("mpd_artist"); | ||||
|     setData(source, key, value_artist); | ||||
|     key = QString("mpd_progress"); | ||||
|     setData(source, key, value_progress); | ||||
|     key = QString("mpd_duration"); | ||||
|     setData(source, key, value_duration); | ||||
|     key = QString("mpd_title"); | ||||
|     setData(source, key, value); | ||||
|   } | ||||
|   else if (source == QString("custom")) { | ||||
|     QProcess custom; | ||||
|     custom.start(QString("bash -c \"") + QString(customCommand) + QString("\"")); | ||||
|     custom.waitForFinished(-1); | ||||
|     value = QTextCodec::codecForMib(106)->toUnicode(custom.readAllStandardOutput()).trimmed(); | ||||
|     key = QString("custom"); | ||||
|     setData(source, key, value); | ||||
|   } | ||||
|  | ||||
|   return true; | ||||
|     return true; | ||||
| } | ||||
|  | ||||
|  | ||||
| K_EXPORT_PLASMA_DATAENGINE(extsysmon, ExtendedSysMon) | ||||
|  | ||||
| #include "extsysmon.moc" | ||||
|  | ||||
| @ -22,22 +22,31 @@ | ||||
|  | ||||
| class ExtendedSysMon : public Plasma::DataEngine | ||||
| { | ||||
|   Q_OBJECT | ||||
|     Q_OBJECT | ||||
|  | ||||
| public: | ||||
|   ExtendedSysMon(QObject *parent, const QVariantList &args); | ||||
|     ExtendedSysMon(QObject *parent, const QVariantList &args); | ||||
|     // update functions | ||||
|     QString getCustomCmd(const QString cmd); | ||||
|     float getGpu(const QString device); | ||||
|     float getGpuTemp(const QString device); | ||||
|     float getHddTemp(const QString device); | ||||
|     QStringList getPlayerInfo(const QString playerName, | ||||
|                               const QString mpdAddress = 0, | ||||
|                               const QString mpdPort = 0); | ||||
|  | ||||
| protected: | ||||
|   bool sourceRequestEvent(const QString &name); | ||||
|   bool updateSourceEvent(const QString &source); | ||||
|   bool readConfiguration(); | ||||
|   QStringList sources() const; | ||||
| // main configuration | ||||
|   QStringList hddDev; | ||||
|   QString gpuDev; | ||||
|   QString mpdAddress; | ||||
|   QString mpdPort; | ||||
|   QString customCommand; | ||||
|     bool readConfiguration(); | ||||
|     bool sourceRequestEvent(const QString &name); | ||||
|     bool updateSourceEvent(const QString &source); | ||||
|     QStringList sources() const; | ||||
|  | ||||
| private: | ||||
|     // configuration | ||||
|     QMap<QString, QString> configuration; | ||||
|     // reread configuration | ||||
|     QString getAllHdd(); | ||||
|     QString getAutoGpu(); | ||||
| }; | ||||
|  | ||||
| #endif /* EXTSYSMON_H */ | ||||
|  | ||||
| @ -81,6 +81,7 @@ class ConfigDefinition: | ||||
|                 deConfigFile.write("MPDADDRESS=" + str(self.configpage.ui.lineEdit_mpdaddress.text()) + "\n") | ||||
|                 deConfigFile.write("MPDPORT=" + str(self.configpage.ui.spinBox_mpdport.value()) + "\n") | ||||
|                 deConfigFile.write("CUSTOM=" + str(self.configpage.ui.lineEdit_customCommand.text()) + "\n") | ||||
|                 deConfigFile.write("PKGCMD=" + str(self.configpage.ui.comboBox_pkgCommand.currentText()) + "\n") | ||||
|         except: | ||||
|             pass | ||||
|  | ||||
| @ -173,7 +174,7 @@ class ConfigDefinition: | ||||
|         self.configpage.ui.kcolorcombo_up.setColor(QColor(str(settings.get('up_color', '#ff00ff')))) | ||||
|  | ||||
|         deSettings = {'GPUDEV':'auto', 'HDDDEV':'all', 'MPDADDRESS':'localhost', | ||||
|             'MPDPORT':'6600', 'CUSTOM':'wget -qO- http://ifconfig.me/ip'} | ||||
|             'MPDPORT':'6600', 'CUSTOM':'wget -qO- http://ifconfig.me/ip', 'PKGCMD':'pacman -Qu'} | ||||
|         dataengineConfig = unicode(KGlobal.dirs().localkdedir()) + "/share/config/extsysmon.conf" | ||||
|         try: | ||||
|             with open(dataengineConfig, 'r') as deConfigFile: | ||||
| @ -197,6 +198,8 @@ class ConfigDefinition: | ||||
|         self.configpage.ui.spinBox_mpdport.setValue(int(deSettings['MPDPORT'])) | ||||
|         self.configpage.ui.spinBox_mpdport.setValue(int(deSettings['MPDPORT'])) | ||||
|         self.configpage.ui.lineEdit_customCommand.setText(deSettings['CUSTOM']) | ||||
|         index = self.configpage.ui.comboBox_pkgCommand.findText(deSettings['PKGCMD']) | ||||
|         self.configpage.ui.comboBox_pkgCommand.setCurrentIndex(index) | ||||
|  | ||||
|         labelOrder = str(settings.get('label_order', '1345')) | ||||
|         for label in self.defaults['order'].keys(): | ||||
|  | ||||
| @ -40,7 +40,8 @@ class ConfigWindow(QWidget): | ||||
|             'hdd':self.ui.checkBox_hdd, 'hddtemp':self.ui.checkBox_hddTemp, | ||||
|             'mem':self.ui.checkBox_mem, 'net':self.ui.checkBox_net, | ||||
|             'swap':self.ui.checkBox_swap, 'temp':self.ui.checkBox_temp, | ||||
|             'uptime':self.ui.checkBox_uptime, 'player':self.ui.checkBox_player, | ||||
|             'uptime':self.ui.checkBox_uptime, 'pkg':self.ui.checkBox_pkg, | ||||
|             'player':self.ui.checkBox_player, 'ps':self.ui.checkBox_ps, | ||||
|             'time':self.ui.checkBox_time} | ||||
|         self.lineedits = {'bat':self.ui.lineEdit_bat, 'cpu':self.ui.lineEdit_cpu, | ||||
|             'cpuclock':self.ui.lineEdit_cpuclock, 'custom':self.ui.lineEdit_custom, | ||||
| @ -48,7 +49,8 @@ class ConfigWindow(QWidget): | ||||
|             'hdd':self.ui.lineEdit_hdd, 'hddtemp':self.ui.lineEdit_hddTemp, | ||||
|             'mem':self.ui.lineEdit_mem, 'net':self.ui.lineEdit_net, | ||||
|             'swap':self.ui.lineEdit_swap, 'temp':self.ui.lineEdit_temp, | ||||
|             'uptime':self.ui.lineEdit_uptime, 'player':self.ui.lineEdit_player, | ||||
|             'uptime':self.ui.lineEdit_uptime, 'pkg':self.ui.lineEdit_pkg, | ||||
|             'player':self.ui.lineEdit_player, 'ps':self.ui.lineEdit_ps, | ||||
|             'time':self.ui.lineEdit_time} | ||||
|         self.sliders = {'bat':self.ui.slider_bat, 'cpu':self.ui.slider_cpu, | ||||
|             'cpuclock':self.ui.slider_cpuclock, 'custom':self.ui.slider_custom, | ||||
| @ -56,7 +58,8 @@ class ConfigWindow(QWidget): | ||||
|             'hdd':self.ui.slider_hdd, 'hddtemp':self.ui.slider_hddTemp, | ||||
|             'mem':self.ui.slider_mem, 'net':self.ui.slider_net, | ||||
|             'swap':self.ui.slider_swap, 'temp':self.ui.slider_temp, | ||||
|             'uptime':self.ui.slider_uptime, 'player':self.ui.slider_player, | ||||
|             'uptime':self.ui.slider_uptime, 'pkg':self.ui.slider_pkg, | ||||
|             'player':self.ui.slider_player, 'ps':self.ui.slider_ps, | ||||
|             'time':self.ui.slider_time} | ||||
|  | ||||
|         QObject.connect(self.ui.checkBox_netdev, SIGNAL("stateChanged(int)"), self.setNetdevEnabled) | ||||
|  | ||||
| @ -66,6 +66,9 @@ class DataEngine: | ||||
|             dataEngines['system'].connectSource("network/interfaces/" + names['net'] + "/receiver/data", self.parent, interval) | ||||
|         if (bools['player'] > 0): | ||||
|             dataEngines['ext'].connectSource("player", self.parent, interval) | ||||
|         if (bools['ps'] > 0): | ||||
|             dataEngines['system'].connectSource("ps", self.parent, interval) | ||||
|             dataEngines['system'].connectSource("pscount", self.parent, interval) | ||||
|         if (bools['swap'] > 0): | ||||
|             dataEngines['system'].connectSource("mem/swap/free", self.parent, interval) | ||||
|             dataEngines['system'].connectSource("mem/swap/used", self.parent, interval) | ||||
| @ -191,6 +194,17 @@ class DataEngine: | ||||
|                     updatedData['value']['progress'] = str(data[QString(u'qmmp_progress')].toUtf8()).decode("utf-8") | ||||
|                     updatedData['value']['time'] = str(data[QString(u'qmmp_duration')].toUtf8()).decode("utf-8") | ||||
|                     updatedData['value']['title'] = str(data[QString(u'qmmp_title')].toUtf8()).decode("utf-8") | ||||
|             elif (sourceName == "ps"): | ||||
|                 print data[QString(u'value')] | ||||
| #                updatedData['name'] = "ps" | ||||
| #                updatedData['type'] = "num" | ||||
| #                value = data[QString(u'value')].toInt()[0] | ||||
| #                updatedData['value'] = value | ||||
|             elif (sourceName == "pscount"): | ||||
|                 updatedData['name'] = "ps" | ||||
|                 updatedData['type'] = "num" | ||||
|                 value = data[QString(u'value')].toInt()[0] | ||||
|                 updatedData['value'] = value | ||||
|             elif (sourceName == "mem/swap/free"): | ||||
|                 updatedData['name'] = "swap" | ||||
|                 updatedData['type'] = "free" | ||||
| @ -285,6 +299,9 @@ class DataEngine: | ||||
|             dataEngines['system'].disconnectSource("network/interfaces/" + keys['net'] + "/receiver/data", self.parent) | ||||
|         elif (name == "player"): | ||||
|             dataEngines['ext'].disconnectSource("player", self.parent) | ||||
|         elif (name == "ps"): | ||||
|             dataEngines['system'].disconnectSource("ps", self.parent) | ||||
|             dataEngines['system'].disconnectSource("pscount", self.parent) | ||||
|         elif (name == "swap"): | ||||
|             dataEngines['system'].disconnectSource("mem/swap/used", self.parent) | ||||
|             dataEngines['system'].disconnectSource("mem/swap/free", self.parent) | ||||
|  | ||||
| @ -132,29 +132,30 @@ class pyTextWidget(plasmascript.Applet): | ||||
|         self.ptm['defaults']['confBool'] = {'bat':'batBool', 'cpu':'cpuBool', | ||||
|             'cpuclock':'cpuclockBool', 'custom':'customBool', 'gpu':'gpuBool', | ||||
|             'gputemp':'gputempBool', 'hdd':'hddBool', 'hddtemp':'hddtempBool', | ||||
|             'mem':'memBool', 'net':'netBool', 'swap':'swapBool', 'temp':'tempBool', | ||||
|             'uptime':'uptimeBool', 'player':'playerBool', 'time':'timeBool'} | ||||
|             'mem':'memBool', 'net':'netBool', 'pkg':'pkgBool', 'player':'playerBool', | ||||
|             'ps':'psBool', 'swap':'swapBool', 'temp':'tempBool', 'uptime':'uptimeBool', | ||||
|             'time':'timeBool'} | ||||
|         self.ptm['defaults']['confColor'] = {'cpu':'cpu_color', 'cpuclock':'cpuclock_color', | ||||
|             'down':'down_color', 'mem':'mem_color', 'swap':'swap_color', 'up':'up_color'} | ||||
|         self.ptm['defaults']['confFormat'] = {'bat':'batFormat', 'cpu':'cpuFormat', | ||||
|             'cpuclock':'cpuclockFormat', 'custom':'customFormat', 'gpu':'gpuFormat', | ||||
|             'gputemp':'gputempFormat', 'hdd':'hddFormat', 'hddtemp':'hddtempFormat', | ||||
|             'mem':'memFormat', 'net':'netFormat', 'player':'playerFormat', | ||||
|             'swap':'swapFormat', 'temp':'tempFormat', 'time':'timeFormat', | ||||
|             'uptime':'uptimeFormat'} | ||||
|             'mem':'memFormat', 'net':'netFormat', 'pkg':'pkgFormat', | ||||
|             'player':'playerFormat', 'ps':'psFormat', 'swap':'swapFormat', | ||||
|             'temp':'tempFormat', 'time':'timeFormat', 'uptime':'uptimeFormat'} | ||||
|         self.ptm['defaults']['bool'] = {'bat':0, 'cpu':2, 'cpuclock':0, 'custom':0, | ||||
|             'gpu':0, 'gputemp':0, 'hdd':0, 'hddtemp':0, 'mem':2, 'net':2, 'player':0, | ||||
|             'swap':2, 'temp':0, 'time':0, 'uptime':0} | ||||
|             'gpu':0, 'gputemp':0, 'hdd':0, 'hddtemp':0, 'mem':2, 'net':2, 'pkg':0, | ||||
|             'player':0, 'ps':0, 'swap':2, 'temp':0, 'time':0, 'uptime':0} | ||||
|         self.ptm['defaults']['format'] = {'bat':'[bat: $bat%$ac]', 'cpu':'[cpu: $cpu%]', | ||||
|             'cpuclock':'[mhz: $cpucl]', 'custom':'[$custom]', 'gpu':'[gpu: $gpu%]', | ||||
|             'gputemp':'[gpu temp: $gputemp°C]', 'hdd':'[hdd: $hdd0%]', | ||||
|             'hddtemp':'[hdd temp: $hddtemp0°C]', 'mem':'[mem: $mem%]', | ||||
|             'net':'[$netdev: $down/$upKB/s]', 'player':'[$artist - $title]', | ||||
|             'swap':'[swap: $swap%]', 'temp':'[temp: $temp0°C]', | ||||
|             'time':'[$time]', 'uptime':'[uptime: $uptime]'} | ||||
|         self.ptm['defaults']['order'] = {'6':'bat', '1':'cpu', '7':'cpuclock', 'f':'custom', '9':'gpu', | ||||
|             'a':'gputemp', 'b':'hdd', 'c':'hddtemp', '3':'mem', '5':'net', '4':'swap', '2':'temp', | ||||
|             '8':'uptime', 'd':'player', 'e':'time'} | ||||
|             'net':'[$netdev: $down/$upKB/s]', 'pkg':'[upgrade: $pkgcount]', | ||||
|             'player':'[$artist - $title]', 'ps':'[proc: $pscount]', 'swap':'[swap: $swap%]', | ||||
|             'temp':'[temp: $temp0°C]', 'time':'[$time]', 'uptime':'[uptime: $uptime]'} | ||||
|         self.ptm['defaults']['order'] = {'1':'cpu', '2':'temp', '3':'mem', '4':'swap', '5':'net', | ||||
|             '6':'bat', '7':'cpuclock', '8':'uptime', '9':'gpu', 'a':'gputemp', 'b':'hdd', | ||||
|             'c':'hddtemp', 'd':'player', 'e':'time', 'f':'custom', 'g':'ps', 'h':'pkg'} | ||||
|         # labels | ||||
|         self.ptm['labels'] = {} | ||||
|         self.ptm['layout'] = QGraphicsLinearLayout(Qt.Horizontal, self.applet) | ||||
| @ -185,6 +186,7 @@ class pyTextWidget(plasmascript.Applet): | ||||
|         self.ptm['values']['mem'] = {'app':0.0, 'used':0.0, 'free':1.0} | ||||
|         self.ptm['values']['net'] = {"up":0.0, "down":0.0} | ||||
|         self.ptm['values']['player'] = {} | ||||
|         self.ptm['values']['ps'] = {'list':[], 'num':0} | ||||
|         self.ptm['values']['swap'] = {'used':0.0, 'free':1.0} | ||||
|         self.ptm['values']['temp'] = {} | ||||
|         # variables | ||||
| @ -227,6 +229,8 @@ class pyTextWidget(plasmascript.Applet): | ||||
|             self.memText() | ||||
|         if (self.ptm['vars']['bools']['net'] > 0): | ||||
|             self.netText() | ||||
|         if (self.ptm['vars']['bools']['ps'] > 0): | ||||
|             self.psText() | ||||
|         if (self.ptm['vars']['bools']['swap'] > 0): | ||||
|             self.swapText() | ||||
|         if (self.ptm['vars']['bools']['temp'] > 0): | ||||
| @ -416,6 +420,16 @@ class pyTextWidget(plasmascript.Applet): | ||||
|         self.setText("net", text) | ||||
|  | ||||
|  | ||||
|     def psText(self): | ||||
|         """function to set ps text""" | ||||
|         line = self.ptm['vars']['formats']['ps'] | ||||
|         if (line.split('$pscount')[0] != 0): | ||||
|             ps = "%i" % (self.ptm['values']['ps']['num']) | ||||
|             line = line.split('$pscount')[0] + ps + line.split('$pscount')[1] | ||||
|         text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1] | ||||
|         self.setText("ps", text) | ||||
|  | ||||
|  | ||||
|     def swapText(self): | ||||
|         """function to set swap text""" | ||||
|         line = self.ptm['vars']['formats']['swap'] | ||||
|  | ||||
| @ -208,6 +208,8 @@ class PTMNotify: | ||||
|             return self.createText("network") | ||||
|         elif (name == "player"): | ||||
|             return self.createText("player") | ||||
|         elif (name == "ps"): | ||||
|             return self.createText("system") | ||||
|         elif (name == "swap"): | ||||
|             return self.createText("memory") | ||||
|         elif (name == "temp"): | ||||
|  | ||||
| @ -66,7 +66,7 @@ | ||||
|             <x>0</x> | ||||
|             <y>0</y> | ||||
|             <width>526</width> | ||||
|             <height>552</height> | ||||
|             <height>624</height> | ||||
|            </rect> | ||||
|           </property> | ||||
|           <layout class="QVBoxLayout" name="verticalLayout_7"> | ||||
| @ -114,7 +114,7 @@ $custom - custom time format</string> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
| @ -170,7 +170,7 @@ $custom - custom format</string> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
| @ -236,7 +236,7 @@ $cpuN - load CPU for core N, %</string> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
| @ -302,7 +302,7 @@ $cpuclN - CPU clock for core N, MHz</string> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
| @ -360,7 +360,7 @@ $cpuclN - CPU clock for core N, MHz</string> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
| @ -418,7 +418,7 @@ $cpuclN - CPU clock for core N, MHz</string> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
| @ -476,7 +476,7 @@ $cpuclN - CPU clock for core N, MHz</string> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
| @ -539,7 +539,7 @@ $memgb - RAM usage, GB</string> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
| @ -602,7 +602,7 @@ $swapgb - swap usage, GB</string> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
| @ -641,7 +641,9 @@ $swapgb - swap usage, GB</string> | ||||
|              <item> | ||||
|               <widget class="QLineEdit" name="lineEdit_hdd"> | ||||
|                <property name="toolTip"> | ||||
|                 <string>$hddN - usage for mount point N (from 0), %. Example: $hdd0</string> | ||||
|                 <string>$hddN - usage for mount point N (from 0), %. Example: $hdd0 | ||||
| $hddmbN - usage for mount point N (from 0), MB. Example: $hddmb0 | ||||
| $hddgbN - usage for mount point N (from 0), GB. Example: $hddgb0</string> | ||||
|                </property> | ||||
|                <property name="alignment"> | ||||
|                 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||||
| @ -660,7 +662,7 @@ $swapgb - swap usage, GB</string> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
| @ -718,7 +720,7 @@ $swapgb - swap usage, GB</string> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
| @ -781,7 +783,7 @@ $netdev - current network device</string> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
| @ -840,7 +842,7 @@ $ac - AC status</string> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
| @ -902,7 +904,7 @@ $title - song title</string> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
| @ -920,6 +922,138 @@ $title - song title</string> | ||||
|              </item> | ||||
|             </layout> | ||||
|            </item> | ||||
|            <item> | ||||
|             <layout class="QHBoxLayout" name="layout_ps"> | ||||
|              <item> | ||||
|               <widget class="QCheckBox" name="checkBox_ps"> | ||||
|                <property name="minimumSize"> | ||||
|                 <size> | ||||
|                  <width>120</width> | ||||
|                  <height>0</height> | ||||
|                 </size> | ||||
|                </property> | ||||
|                <property name="text"> | ||||
|                 <string>PS</string> | ||||
|                </property> | ||||
|                <property name="checked"> | ||||
|                 <bool>true</bool> | ||||
|                </property> | ||||
|                <property name="tristate"> | ||||
|                 <bool>true</bool> | ||||
|                </property> | ||||
|               </widget> | ||||
|              </item> | ||||
|              <item> | ||||
|               <widget class="QLineEdit" name="lineEdit_ps"> | ||||
|                <property name="toolTip"> | ||||
|                 <string>$cpu - total load CPU, % | ||||
| $cpu0 - load CPU for core 0, % | ||||
| ... | ||||
| $cpu9 - load CPU for core 9, % | ||||
| ... | ||||
| $cpuN - load CPU for core N, %</string> | ||||
|                </property> | ||||
|                <property name="alignment"> | ||||
|                 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||||
|                </property> | ||||
|               </widget> | ||||
|              </item> | ||||
|              <item> | ||||
|               <widget class="QSlider" name="slider_ps"> | ||||
|                <property name="maximumSize"> | ||||
|                 <size> | ||||
|                  <width>120</width> | ||||
|                  <height>16777215</height> | ||||
|                 </size> | ||||
|                </property> | ||||
|                <property name="minimum"> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="value"> | ||||
|                 <number>15</number> | ||||
|                </property> | ||||
|                <property name="orientation"> | ||||
|                 <enum>Qt::Horizontal</enum> | ||||
|                </property> | ||||
|                <property name="tickPosition"> | ||||
|                 <enum>QSlider::TicksAbove</enum> | ||||
|                </property> | ||||
|               </widget> | ||||
|              </item> | ||||
|             </layout> | ||||
|            </item> | ||||
|            <item> | ||||
|             <layout class="QHBoxLayout" name="layout_pkg"> | ||||
|              <item> | ||||
|               <widget class="QCheckBox" name="checkBox_pkg"> | ||||
|                <property name="minimumSize"> | ||||
|                 <size> | ||||
|                  <width>120</width> | ||||
|                  <height>0</height> | ||||
|                 </size> | ||||
|                </property> | ||||
|                <property name="text"> | ||||
|                 <string>Package manager</string> | ||||
|                </property> | ||||
|                <property name="checked"> | ||||
|                 <bool>true</bool> | ||||
|                </property> | ||||
|                <property name="tristate"> | ||||
|                 <bool>true</bool> | ||||
|                </property> | ||||
|               </widget> | ||||
|              </item> | ||||
|              <item> | ||||
|               <widget class="QLineEdit" name="lineEdit_pkg"> | ||||
|                <property name="toolTip"> | ||||
|                 <string>$cpu - total load CPU, % | ||||
| $cpu0 - load CPU for core 0, % | ||||
| ... | ||||
| $cpu9 - load CPU for core 9, % | ||||
| ... | ||||
| $cpuN - load CPU for core N, %</string> | ||||
|                </property> | ||||
|                <property name="alignment"> | ||||
|                 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||||
|                </property> | ||||
|               </widget> | ||||
|              </item> | ||||
|              <item> | ||||
|               <widget class="QSlider" name="slider_pkg"> | ||||
|                <property name="maximumSize"> | ||||
|                 <size> | ||||
|                  <width>120</width> | ||||
|                  <height>16777215</height> | ||||
|                 </size> | ||||
|                </property> | ||||
|                <property name="minimum"> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="value"> | ||||
|                 <number>16</number> | ||||
|                </property> | ||||
|                <property name="orientation"> | ||||
|                 <enum>Qt::Horizontal</enum> | ||||
|                </property> | ||||
|                <property name="tickPosition"> | ||||
|                 <enum>QSlider::TicksAbove</enum> | ||||
|                </property> | ||||
|               </widget> | ||||
|              </item> | ||||
|             </layout> | ||||
|            </item> | ||||
|            <item> | ||||
|             <layout class="QHBoxLayout" name="layout_custom"> | ||||
|              <item> | ||||
| @ -960,13 +1094,13 @@ $title - song title</string> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="maximum"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="pageStep"> | ||||
|                 <number>1</number> | ||||
|                </property> | ||||
|                <property name="value"> | ||||
|                 <number>15</number> | ||||
|                 <number>17</number> | ||||
|                </property> | ||||
|                <property name="orientation"> | ||||
|                 <enum>Qt::Horizontal</enum> | ||||
| @ -1012,7 +1146,7 @@ $title - song title</string> | ||||
|            <rect> | ||||
|             <x>0</x> | ||||
|             <y>0</y> | ||||
|             <width>328</width> | ||||
|             <width>526</width> | ||||
|             <height>611</height> | ||||
|            </rect> | ||||
|           </property> | ||||
| @ -1522,8 +1656,8 @@ del - remove item</string> | ||||
|            <rect> | ||||
|             <x>0</x> | ||||
|             <y>0</y> | ||||
|             <width>326</width> | ||||
|             <height>227</height> | ||||
|             <width>544</width> | ||||
|             <height>504</height> | ||||
|            </rect> | ||||
|           </property> | ||||
|           <layout class="QVBoxLayout" name="verticalLayout_9"> | ||||
| @ -1856,8 +1990,8 @@ del - remove item</string> | ||||
|            <rect> | ||||
|             <x>0</x> | ||||
|             <y>0</y> | ||||
|             <width>326</width> | ||||
|             <height>190</height> | ||||
|             <width>544</width> | ||||
|             <height>540</height> | ||||
|            </rect> | ||||
|           </property> | ||||
|           <layout class="QVBoxLayout" name="verticalLayout_10"> | ||||
| @ -2190,8 +2324,8 @@ del - remove item</string> | ||||
|            <rect> | ||||
|             <x>0</x> | ||||
|             <y>0</y> | ||||
|             <width>326</width> | ||||
|             <height>161</height> | ||||
|             <width>544</width> | ||||
|             <height>540</height> | ||||
|            </rect> | ||||
|           </property> | ||||
|           <layout class="QVBoxLayout" name="verticalLayout_11"> | ||||
| @ -2382,6 +2516,56 @@ del - remove item</string> | ||||
|              </item> | ||||
|             </layout> | ||||
|            </item> | ||||
|            <item> | ||||
|             <layout class="QHBoxLayout" name="layout_pkgCommand"> | ||||
|              <item> | ||||
|               <widget class="QLabel" name="label_pkgCommand"> | ||||
|                <property name="minimumSize"> | ||||
|                 <size> | ||||
|                  <width>120</width> | ||||
|                  <height>0</height> | ||||
|                 </size> | ||||
|                </property> | ||||
|                <property name="text"> | ||||
|                 <string>Package manager</string> | ||||
|                </property> | ||||
|               </widget> | ||||
|              </item> | ||||
|              <item> | ||||
|               <widget class="QComboBox" name="comboBox_pkgCommand"> | ||||
|                <property name="sizePolicy"> | ||||
|                 <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> | ||||
|                  <horstretch>0</horstretch> | ||||
|                  <verstretch>0</verstretch> | ||||
|                 </sizepolicy> | ||||
|                </property> | ||||
|                <property name="editable"> | ||||
|                 <bool>true</bool> | ||||
|                </property> | ||||
|                <item> | ||||
|                 <property name="text"> | ||||
|                  <string>pacman -Qu</string> | ||||
|                 </property> | ||||
|                </item> | ||||
|                <item> | ||||
|                 <property name="text"> | ||||
|                  <string>apt-show-versions -u -b</string> | ||||
|                 </property> | ||||
|                </item> | ||||
|                <item> | ||||
|                 <property name="text"> | ||||
|                  <string>aptitude search '~U'</string> | ||||
|                 </property> | ||||
|                </item> | ||||
|                <item> | ||||
|                 <property name="text"> | ||||
|                  <string>yum list updates</string> | ||||
|                 </property> | ||||
|                </item> | ||||
|               </widget> | ||||
|              </item> | ||||
|             </layout> | ||||
|            </item> | ||||
|            <item> | ||||
|             <spacer name="spacer_dataengine"> | ||||
|              <property name="orientation"> | ||||
| @ -2457,6 +2641,12 @@ del - remove item</string> | ||||
|   <tabstop>checkBox_player</tabstop> | ||||
|   <tabstop>lineEdit_player</tabstop> | ||||
|   <tabstop>slider_player</tabstop> | ||||
|   <tabstop>checkBox_ps</tabstop> | ||||
|   <tabstop>lineEdit_ps</tabstop> | ||||
|   <tabstop>slider_ps</tabstop> | ||||
|   <tabstop>checkBox_pkg</tabstop> | ||||
|   <tabstop>lineEdit_pkg</tabstop> | ||||
|   <tabstop>slider_pkg</tabstop> | ||||
|   <tabstop>checkBox_custom</tabstop> | ||||
|   <tabstop>lineEdit_custom</tabstop> | ||||
|   <tabstop>slider_custom</tabstop> | ||||
|  | ||||
		Reference in New Issue
	
	Block a user