diff --git a/sources/CMakeLists.txt b/sources/CMakeLists.txt index b2ca374..7fc00c2 100644 --- a/sources/CMakeLists.txt +++ b/sources/CMakeLists.txt @@ -47,6 +47,3 @@ endif () # translations # add_subdirectory (translations) -# aw bars desktops -set (AW_DESKTOPS ${CMAKE_CURRENT_SOURCE_DIR}/desktops) -install (DIRECTORY ${AW_DESKTOPS} DESTINATION ${DATA_INSTALL_DIR}/plasma_applet_awesome-widget) diff --git a/sources/awesome-widget-kde4/CMakeLists.txt b/sources/awesome-widget-kde4/CMakeLists.txt index 3387f9f..e652484 100644 --- a/sources/awesome-widget-kde4/CMakeLists.txt +++ b/sources/awesome-widget-kde4/CMakeLists.txt @@ -26,6 +26,7 @@ file (GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp set (TASK_HEADER ${PROJECT_TRDPARTY_DIR}/task/task.h) file (GLOB SUBPROJECT_UI *.ui ${PROJECT_TRDPARTY_DIR}/about/*.ui) file (GLOB SUBPROJECT_NOTIFY *.notifyrc) +set (SUBPROJECT_DESKTOPS ${CMAKE_CURRENT_SOURCE_DIR}/desktops) # prepare configure_file (${SUBPROJECT_DESKTOP_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP}) @@ -40,3 +41,4 @@ target_link_libraries (${PLUGIN_NAME} ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} ${K install (TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_INSTALL_DIR}) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR}) install (FILES ${SUBPROJECT_NOTIFY} DESTINATION ${DATA_INSTALL_DIR}/${PLUGIN_NAME}) +install (DIRECTORY ${SUBPROJECT_DESKTOPS} DESTINATION ${DATA_INSTALL_DIR}/${PLUGIN_NAME}) diff --git a/sources/awesome-widget-kde4/configuration.cpp b/sources/awesome-widget-kde4/configuration.cpp index 6630f58..50518e8 100644 --- a/sources/awesome-widget-kde4/configuration.cpp +++ b/sources/awesome-widget-kde4/configuration.cpp @@ -825,7 +825,7 @@ void AwesomeWidget::contextMenuCustomCommand(const QPoint pos) else if (action == copy) copyCustomCommand(uiDEConfig.listWidget_custom->currentItem()->text()); else if (action == remove) { - QStringList dirs = KGlobal::dirs()->findDirs("data", "plasma_engine_extsysmon/scripts"); + QStringList dirs = KGlobal::dirs()->findDirs("data", "plasma_dataengine_extsysmon/scripts"); ExtScript *script = new ExtScript(0, uiDEConfig.listWidget_custom->currentItem()->text(), dirs, debug); script->tryDelete(); delete script; @@ -954,7 +954,7 @@ void AwesomeWidget::editCustomCommand(QListWidgetItem *item) { if (debug) qDebug() << PDEBUG; - QStringList dirs = KGlobal::dirs()->findDirs("data", "plasma_engine_extsysmon/scripts"); + QStringList dirs = KGlobal::dirs()->findDirs("data", "plasma_dataengine_extsysmon/scripts"); ExtScript *script = new ExtScript(0, item->text(), dirs, debug); script->showConfiguration(); } @@ -1006,11 +1006,11 @@ QList AwesomeWidget::initScripts() QList externalScripts; // create directory at $HOME - QString localDir = KStandardDirs::locateLocal("data", "plasma_engine_extsysmon/scripts"); + QString localDir = KStandardDirs::locateLocal("data", "plasma_dataengine_extsysmon/scripts"); if (KStandardDirs::makeDir(localDir)) if (debug) qDebug() << PDEBUG << ":" << "Created directory" << localDir; - QStringList dirs = KGlobal::dirs()->findDirs("data", "plasma_engine_extsysmon/scripts"); + QStringList dirs = KGlobal::dirs()->findDirs("data", "plasma_dataengine_extsysmon/scripts"); QStringList names; for (int i=0; iproject homepage") + } + + Row { + height: implicitHeight + width: parent.width + QtControls.Button { + text: i18n("Font") + + onClicked: { + if (debug) console.log("[widget::onClicked] : Font button") + + var defaultFont = { + "color": plasmoid.configuration.fontColor, + "family": plasmoid.configuration.fontFamily, + "size": plasmoid.configuration.fontSize + } + var font = AWActions.getFont(defaultFont) + var pos = textPattern.cursorPosition + var selected = textPattern.selectedText + textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd) + textPattern.insert(pos, "" + + selected + "") + } + } + QtControls.Button { + iconName: "format-indent-more" + + onClicked: { + if (debug) console.log("[widget::onClicked] : Indent button") + + var pos = textPattern.cursorPosition + var selected = textPattern.selectedText + textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd) + textPattern.insert(pos, selected + "
\n") + } + } + + QtControls.Button { + iconName: "format-text-bold" + + onClicked: { + if (debug) console.log("[widget::onClicked] : Bold button") + + var pos = textPattern.cursorPosition + var selected = textPattern.selectedText + textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd) + textPattern.insert(pos, "" + selected + "") + } + } + QtControls.Button { + iconName: "format-text-italic" + + onClicked: { + if (debug) console.log("[widget::onClicked] : Italic button") + + var pos = textPattern.cursorPosition + var selected = textPattern.selectedText + textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd) + textPattern.insert(pos, "" + selected + "") + } + } + QtControls.Button { + iconName: "format-text-underline" + + onClicked: { + if (debug) console.log("[widget::onClicked] : Underline button") + + var pos = textPattern.cursorPosition + var selected = textPattern.selectedText + textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd) + textPattern.insert(pos, "" + selected + "") + } + } + QtControls.Button { + iconName: "format-text-strikethrough" + + onClicked: { + if (debug) console.log("[widget::onClicked] : Strike button") + + var pos = textPattern.cursorPosition + var selected = textPattern.selectedText + textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd) + textPattern.insert(pos, "" + selected + "") + } + } + + QtControls.Button { + iconName: "format-justify-left" + + onClicked: { + if (debug) console.log("[widget::onClicked] : Left button") + + var pos = textPattern.cursorPosition + var selected = textPattern.selectedText + textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd) + textPattern.insert(pos, "

" + selected + "" + selected + "" + selected + "" + selected + "Value: %2", tags.currentText, AWKeys.valueByKey(tags.currentText)) + AWActions.sendNotification("tag", message) + } + } + } + + QtControls.TextArea { + id: textPattern + width: parent.width + textFormat: TextEdit.PlainText + text: plasmoid.configuration.text + } + } + + Component.onCompleted: { + if (debug) console.log("[widget::onCompleted]") + } +} diff --git a/sources/awesome-widget-kf5/plugin/CMakeLists.txt b/sources/awesome-widget-kf5/plugin/CMakeLists.txt index 823c228..8431aee 100644 --- a/sources/awesome-widget-kf5/plugin/CMakeLists.txt +++ b/sources/awesome-widget-kf5/plugin/CMakeLists.txt @@ -27,8 +27,11 @@ file (GLOB SUBPROJECT_NOTIFY *.notifyrc) file (GLOB SUBPROJECT_UI *.ui) # task source is required by extscripts file (GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp - ../../extsysmon/extscript.cpp) + ${PROJECT_TRDPARTY_DIR}/fontdialog/*.cpp + ../../extsysmon/extscript.cpp + ../../extsysmon/extupgrade.cpp) set (TASK_HEADER ${PROJECT_TRDPARTY_DIR}/task/task.h) +set (SUBPROJECT_DESKTOPS ${CMAKE_CURRENT_SOURCE_DIR}/desktops) qt5_wrap_cpp (TASK_MOC_SOURCE ${TASK_HEADER}) qt5_wrap_ui (SUBPROJECT_UI_HEADER ${SUBPROJECT_UI}) @@ -38,3 +41,4 @@ target_link_libraries (${PLUGIN_NAME} ${Qt_LIBRARIES} ${Kf5_LIBRARIES}) install (TARGETS ${PLUGIN_NAME} DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/awesomewidget) install (FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/awesomewidget) install (FILES ${SUBPROJECT_NOTIFY} DESTINATION ${KNOTIFYRC_INSTALL_DIR}) +install (DIRECTORY ${SUBPROJECT_DESKTOPS} DESTINATION ${DATA_INSTALL_DIR}/${PLUGIN_NAME}) diff --git a/sources/awesome-widget-kf5/plugin/awactions.cpp b/sources/awesome-widget-kf5/plugin/awactions.cpp index 5bee110..dcbd110 100644 --- a/sources/awesome-widget-kf5/plugin/awactions.cpp +++ b/sources/awesome-widget-kf5/plugin/awactions.cpp @@ -22,16 +22,18 @@ #include #include +#include #include #include #include #include #include #include +#include #include #include -#include +#include #include #include "extscript.h" @@ -97,6 +99,94 @@ void AWActions::showReadme() } +void AWActions::addDevice(const QString source) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Source" << source; + + QRegExp diskRegexp = QRegExp(QString("disk/(?:md|sd|hd)[a-z|0-9]_.*/Rate/(?:rblk)")); + QRegExp fanRegexp = QRegExp(QString("lmsensors/.*/fan.*")); + QRegExp mountRegexp = QRegExp(QString("partitions/.*/filllevel")); + QRegExp tempRegexp = QRegExp(QString("lmsensors/.*temp.*/.*")); + + if (diskRegexp.indexIn(source) > -1) { + QStringList splitSource = source.split(QChar('/')); + QString device = splitSource[0] + QString("/") + splitSource[1]; + diskDevices.append(device); + } else if (fanRegexp.indexIn(source) > -1) + fanDevices.append(source); + else if (mountRegexp.indexIn(source) > -1) { + QString device = source; + device.remove(QString("partitions")).remove(QString("/filllevel")); + mountDevices.append(device); + } else if (tempRegexp.indexIn(source) > -1) + tempDevices.append(source); +} + + +QStringList AWActions::getDiskDevices() +{ + if (debug) qDebug() << PDEBUG; + + return diskDevices; +} + + +QStringList AWActions::getFanDevices() +{ + if (debug) qDebug() << PDEBUG; + + return fanDevices; +} + + +QStringList AWActions::getHddDevices() +{ + if (debug) qDebug() << PDEBUG; + + QStringList allDevices = QDir(QString("/dev")).entryList(QDir::System, QDir::Name); + QStringList devices = allDevices.filter(QRegExp(QString("^[hms]d[a-z]$"))); + for (int i=0; i AWActions::getFont(const QMap defaultFont) +{ + if (debug) qDebug() << PDEBUG; + + QMap fontMap; + CFont defaultCFont = CFont(defaultFont[QString("family")].toString(), + defaultFont[QString("size")].toInt(), + 400, false, defaultFont[QString("color")].toString()); + CFont font = CFontDialog::getFont(i18n("Select font"), defaultCFont, + false, false); + fontMap[QString("color")] = font.color().name(); + fontMap[QString("family")] = font.family(); + fontMap[QString("size")] = font.pointSize(); + + return fontMap; +} + + QMap AWActions::readDataEngineConfiguration() { if (debug) qDebug() << PDEBUG; diff --git a/sources/awesome-widget-kf5/plugin/awactions.h b/sources/awesome-widget-kf5/plugin/awactions.h index fa015f5..3118085 100644 --- a/sources/awesome-widget-kf5/plugin/awactions.h +++ b/sources/awesome-widget-kf5/plugin/awactions.h @@ -38,6 +38,14 @@ public: Q_INVOKABLE void runCmd(const QString cmd = QString("/usr/bin/true")); Q_INVOKABLE void sendNotification(const QString eventId, const QString message); Q_INVOKABLE void showReadme(); + // configuration slots + Q_INVOKABLE void addDevice(const QString source); + Q_INVOKABLE QStringList getDiskDevices(); + Q_INVOKABLE QStringList getFanDevices(); + Q_INVOKABLE QStringList getHddDevices(); + Q_INVOKABLE QStringList getMountDevices(); + Q_INVOKABLE QStringList getTempDevices(); + Q_INVOKABLE QMap getFont(const QMap defaultFont); // dataengine Q_INVOKABLE QMap readDataEngineConfiguration(); Q_INVOKABLE void writeDataEngineConfiguration(const QMap configuration); @@ -50,6 +58,7 @@ private: QMap updateDataEngineConfiguration(QMap rawConfig); // variables bool debug = false; + QStringList diskDevices, fanDevices, mountDevices, tempDevices; }; diff --git a/sources/awesome-widget-kf5/plugin/awkeys.cpp b/sources/awesome-widget-kf5/plugin/awkeys.cpp index d0d2a56..fe5dda3 100644 --- a/sources/awesome-widget-kf5/plugin/awkeys.cpp +++ b/sources/awesome-widget-kf5/plugin/awkeys.cpp @@ -30,6 +30,7 @@ #include "awtooltip.h" #include "extscript.h" +#include "extupgrade.h" #include "graphicalitem.h" #include "version.h" @@ -58,6 +59,7 @@ void AWKeys::initKeys(const QString pattern, // clear extScripts.clear(); + extUpgrade.clear(); graphicalItems.clear(); counts.clear(); keys.clear(); @@ -67,6 +69,7 @@ void AWKeys::initKeys(const QString pattern, // init extScripts = getExtScripts(); + extUpgrade = getExtUpgrade(); graphicalItems = getGraphicalItems(); counts = getCounts(params); keys = dictKeys(); @@ -94,36 +97,6 @@ bool AWKeys::isReady() } -QString AWKeys::networkDevice(const QString custom) -{ - if (debug) qDebug() << PDEBUG; - if (debug) qDebug() << PDEBUG << ":" << "Custom device" << custom; - - QString device = QString("lo"); - if (custom.isEmpty()) { - QList rawInterfaceList = QNetworkInterface::allInterfaces(); - for (int i=0; iimage(values[key].toFloat())); - } + parsed.replace(QString("$") + foundKeys[i], valueByKey(foundKeys[i])); + for (int i=0; iimage(valueByKey(foundBars[i]).toFloat())); parsed.replace(QString("$\\$\\"), QString("$$")); return parsed; } -float AWKeys::temperature(const float temp, const QString units) +QPixmap AWKeys::toolTipImage() { - if (debug) qDebug() << PDEBUG; + if(debug) qDebug() << PDEBUG; - float converted = temp; - if (units == QString("Celsius")) - ; - else if (units == QString("Fahrenheit")) - converted = temp * 9.0 / 5.0 + 32.0; - else if (units == QString("Kelvin")) - converted = temp + 273.15; - else if (units == QString("Reaumur")) - converted = temp * 0.8; - else if (units == QString("cm^-1")) - converted = (temp + 273.15) * 0.695; - else if (units == QString("kJ/mol")) - converted = (temp + 273.15) * 8.31; - else if (units == QString("kcal/mol")) - converted = (temp + 273.15) * 1.98; - - return converted; + return toolTip->image(); } @@ -280,6 +234,24 @@ QStringList AWKeys::extScriptsInfo() info.append(extScripts[i]->name()); info.append(extScripts[i]->comment()); info.append(extScripts[i]->executable()); + info.append(QVariant(extScripts[i]->isActive()).toString()); + } + + return info; +} + + +QStringList AWKeys::extUpgradeInfo() +{ + if (debug) qDebug() << PDEBUG; + + QStringList info; + for (int i=0; ifileName()); + info.append(extUpgrade[i]->name()); + info.append(extUpgrade[i]->comment()); + info.append(extUpgrade[i]->executable()); + info.append(QVariant(extUpgrade[i]->isActive()).toString()); } return info; @@ -381,11 +353,11 @@ void AWKeys::setDataBySource(const QString sourceName, } } else if (sourceName == QString("gpu")) { // gpu load - values[QString("gpu")] = QString("%1").arg(data[QString("GPU")].toFloat(), 5, 'f', 1); + values[QString("gpu")] = QString("%1").arg(data[QString("value")].toFloat(), 5, 'f', 1); } else if (sourceName == QString("gputemp")) { // gpu temperature values[QString("gputemp")] = QString("%1").arg( - temperature(data[QString("GPUTemp")].toFloat(),params[QString("tempUnits")].toString()), 4, 'f', 1); + temperature(data[QString("value")].toFloat(), params[QString("tempUnits")].toString()), 4, 'f', 1); } else if (sourceName.contains(mountFillRegExp)) { // fill level QString mount = sourceName; @@ -554,6 +526,71 @@ void AWKeys::setDataBySource(const QString sourceName, } +QString AWKeys::valueByKey(QString key) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Requested key" << key; + + key.remove(QRegExp(QString("^bar[0-9]{1,}"))); + + return values[key]; +} + + +QString AWKeys::networkDevice(const QString custom) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Custom device" << custom; + + QString device = QString("lo"); + if (custom.isEmpty()) { + QList rawInterfaceList = QNetworkInterface::allInterfaces(); + for (int i=0; i AWKeys::getCounts(const QMap params) awCounts[QString("fan")] = params[QString("fanDevice")].toString().split(QString("@@")).count(); awCounts[QString("hddtemp")] = params[QString("hdd")].toString().split(QString("@@")).count(); awCounts[QString("mount")] = params[QString("mount")].toString().split(QString("@@")).count(); - // TODO update pkg parsing -// awCounts[QString("pkg")] = deSettings[QString("PKGCMD")].split(QChar(',')).count(); - awCounts[QString("pkg")] = 1; + awCounts[QString("pkg")] = extUpgrade.count(); awCounts[QString("temp")] = params[QString("tempDevice")].toString().split(QString("@@")).count(); return awCounts; @@ -614,13 +649,13 @@ QList AWKeys::getExtScripts() QList externalScripts; // create directory at $HOME QString localDir = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + - QString("/plasma_engine_extsysmon/scripts"); + QString("/plasma_dataengine_extsysmon/scripts"); QDir localDirectory; if ((!localDirectory.exists(localDir)) && (localDirectory.mkpath(localDir))) if (debug) qDebug() << PDEBUG << ":" << "Created directory" << localDir; QStringList dirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, - QString("plasma_engine_extsysmon/scripts"), + QString("plasma_dataengine_extsysmon/scripts"), QStandardPaths::LocateDirectory); QStringList names; for (int i=0; i AWKeys::getExtScripts() } +QList AWKeys::getExtUpgrade() +{ + if (debug) qDebug() << PDEBUG; + + QList externalUpgrade; + // create directory at $HOME + QString localDir = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + + QString("/plasma_dataengine_extsysmon/upgrade"); + QDir localDirectory; + if ((!localDirectory.exists(localDir)) && (localDirectory.mkpath(localDir))) + if (debug) qDebug() << PDEBUG << ":" << "Created directory" << localDir; + + QStringList dirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, + QString("plasma_dataengine_extsysmon/upgrade"), + QStandardPaths::LocateDirectory); + QStringList names; + for (int i=0; i AWKeys::getGraphicalItems() { if (debug) qDebug() << PDEBUG; diff --git a/sources/awesome-widget-kf5/plugin/awkeys.h b/sources/awesome-widget-kf5/plugin/awkeys.h index 9119b52..c5200bf 100644 --- a/sources/awesome-widget-kf5/plugin/awkeys.h +++ b/sources/awesome-widget-kf5/plugin/awkeys.h @@ -22,11 +22,13 @@ #include #include #include +#include #include class AWToolTip; class ExtScript; +class ExtUpgrade; class GraphicalItem; class AWKeys : public QObject @@ -42,23 +44,31 @@ public: const QMap tooltipParams); Q_INVOKABLE bool isDebugEnabled(); Q_INVOKABLE bool isReady(); - Q_INVOKABLE QString networkDevice(const QString custom = QString("")); - Q_INVOKABLE int numberCpus(); Q_INVOKABLE QString parsePattern(const QString pattern); - Q_INVOKABLE float temperature(const float temp, const QString units = QString("Celsius")); + Q_INVOKABLE QPixmap toolTipImage(); // keys Q_INVOKABLE QStringList dictKeys(); Q_INVOKABLE QStringList extScriptsInfo(); + Q_INVOKABLE QStringList extUpgradeInfo(); Q_INVOKABLE QStringList graphicalItemsInfo(); Q_INVOKABLE void setDataBySource(const QString sourceName, const QMap data, const QMap params); - Q_INVOKABLE QStringList findGraphicalItems(const QString pattern); - Q_INVOKABLE QStringList findKeys(const QString pattern); + // values + Q_INVOKABLE QString valueByKey(QString key); private: + // methods + QString networkDevice(const QString custom = QString("")); + int numberCpus(); + float temperature(const float temp, const QString units = QString("Celsius")); + // find methods + QStringList findGraphicalItems(const QString pattern); + QStringList findKeys(const QString pattern); + // get methods QMap getCounts(const QMap params); QList getExtScripts(); + QList getExtUpgrade(); QList getGraphicalItems(); GraphicalItem *getItemByTag(const QString tag); QStringList getTimeKeys(); @@ -68,6 +78,7 @@ private: bool ready = false; QList graphicalItems; QList extScripts; + QList extUpgrade; QStringList foundBars, foundKeys, keys; QMap counts; QMap values; diff --git a/sources/awesome-widget-kf5/plugin/awtooltip.h b/sources/awesome-widget-kf5/plugin/awtooltip.h index 010de23..9bd331b 100644 --- a/sources/awesome-widget-kf5/plugin/awtooltip.h +++ b/sources/awesome-widget-kf5/plugin/awtooltip.h @@ -34,7 +34,7 @@ public: QMap m_settings = QMap()); ~AWToolTip(); - Q_INVOKABLE QPixmap image(); + QPixmap image(); void setData(const QString source, const float value, const bool ac = true); diff --git a/sources/awesome-widget-kf5/plugin/desktops/aw-bat-bar.desktop b/sources/awesome-widget-kf5/plugin/desktops/aw-bat-bar.desktop new file mode 100644 index 0000000..71fe557 --- /dev/null +++ b/sources/awesome-widget-kf5/plugin/desktops/aw-bat-bar.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=bar3 +Comment=Simple bat bar +X-AW-Value=bat +X-AW-ActiveColor="0,0,0,255" +X-AW-InactiveColor="255,255,255,255" +X-AW-Type=Horizontal +X-AW-Direction=LeftToRight +X-AW-Height=25 +X-AW-Width=100 +X-AW-ApiVersion=1 diff --git a/sources/awesome-widget-kf5/plugin/desktops/aw-cpu-bar.desktop b/sources/awesome-widget-kf5/plugin/desktops/aw-cpu-bar.desktop new file mode 100644 index 0000000..b1bfe3c --- /dev/null +++ b/sources/awesome-widget-kf5/plugin/desktops/aw-cpu-bar.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=bar0 +Comment=Simple cpu bar +X-AW-Value=cpu +X-AW-ActiveColor="0,0,0,255" +X-AW-InactiveColor="255,255,255,255" +X-AW-Type=Horizontal +X-AW-Direction=LeftToRight +X-AW-Height=25 +X-AW-Width=100 +X-AW-ApiVersion=1 diff --git a/sources/awesome-widget-kf5/plugin/desktops/aw-mem-bar.desktop b/sources/awesome-widget-kf5/plugin/desktops/aw-mem-bar.desktop new file mode 100644 index 0000000..da4971b --- /dev/null +++ b/sources/awesome-widget-kf5/plugin/desktops/aw-mem-bar.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=bar1 +Comment=Simple mem bar +X-AW-Value=mem +X-AW-ActiveColor="0,0,0,255" +X-AW-InactiveColor="255,255,255,255" +X-AW-Type=Horizontal +X-AW-Direction=LeftToRight +X-AW-Height=25 +X-AW-Width=100 +X-AW-ApiVersion=1 diff --git a/sources/awesome-widget-kf5/plugin/desktops/aw-swap-bar.desktop b/sources/awesome-widget-kf5/plugin/desktops/aw-swap-bar.desktop new file mode 100644 index 0000000..bc62658 --- /dev/null +++ b/sources/awesome-widget-kf5/plugin/desktops/aw-swap-bar.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=bar2 +Comment=Simple swap bar +X-AW-Value=swap +X-AW-ActiveColor="0,0,0,255" +X-AW-InactiveColor="255,255,255,255" +X-AW-Type=Horizontal +X-AW-Direction=LeftToRight +X-AW-Height=25 +X-AW-Width=100 +X-AW-ApiVersion=1 diff --git a/sources/awesome-widget-kf5/plugin/desktops/bar-template.desktop b/sources/awesome-widget-kf5/plugin/desktops/bar-template.desktop new file mode 100644 index 0000000..2f696e1 --- /dev/null +++ b/sources/awesome-widget-kf5/plugin/desktops/bar-template.desktop @@ -0,0 +1,25 @@ +[Desktop Entry] +Encoding=UTF-8 +# name should be barN and uniq +Name=bar100500 +Comment=Template for the AW bars +# value to show. Supported types are +# cpu, cpu[0-9], mem, swap, bat +X-AW-Value=cpu +# active color, RGBA +# you should use double quotes +X-AW-ActiveColor="0,0,0,255" +# inactive color, RGBA +# you should use double quotes +X-AW-InactiveColor="255,255,255,255" +# bar type. Supported types are +# Horizontal, Vertical, Circle +X-AW-Type=Horizontal +# direction. LeftToRight or RightToLeft +X-AW-Direction=LeftToRight +# height in pixels +X-AW-Height=25 +# width in pixels +X-AW-Width=100 +# API version +X-AW-ApiVersion=1 diff --git a/sources/extsysmon/CMakeLists.txt b/sources/extsysmon/CMakeLists.txt index 0514873..84177ee 100644 --- a/sources/extsysmon/CMakeLists.txt +++ b/sources/extsysmon/CMakeLists.txt @@ -1,5 +1,5 @@ # set project name -set (SUBPROJECT plasma_engine_extsysmon) +set (SUBPROJECT plasma_dataengine_extsysmon) set (PLUGIN_NAME ${SUBPROJECT}) message (STATUS "Subproject ${SUBPROJECT}") @@ -42,6 +42,7 @@ set (TASK_HEADER ${PROJECT_TRDPARTY_DIR}/task/task.h) file (GLOB SUBPROJECT_UI *.ui) file (GLOB SUBPROJECT_CONF *.conf) set (SUBPROJECT_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/scripts) +set (SUBPROJECT_UPGRADE ${CMAKE_CURRENT_SOURCE_DIR}/upgrade) # prepare configure_file (${SUBPROJECT_DESKTOP_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP}) @@ -69,3 +70,4 @@ endif () install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR}) install (FILES ${SUBPROJECT_CONF} DESTINATION ${CONFIG_INSTALL_DIR}) install (DIRECTORY ${SUBPROJECT_SCRIPTS} DESTINATION ${DATA_INSTALL_DIR}/${PLUGIN_NAME}) +install (DIRECTORY ${SUBPROJECT_UPGRADE} DESTINATION ${DATA_INSTALL_DIR}/${PLUGIN_NAME}) diff --git a/sources/extsysmon/extscript.cpp b/sources/extsysmon/extscript.cpp index 10ee162..5922bbd 100644 --- a/sources/extsysmon/extscript.cpp +++ b/sources/extsysmon/extscript.cpp @@ -29,12 +29,12 @@ #include "version.h" -ExtScript::ExtScript(QWidget *parent, const QString scriptName, const QStringList directories, const bool debugCmd) : - QDialog(parent), - m_fileName(scriptName), - m_dirs(directories), - debug(debugCmd), - ui(new Ui::ExtScript) +ExtScript::ExtScript(QWidget *parent, const QString scriptName, const QStringList directories, const bool debugCmd) + : QDialog(parent), + m_fileName(scriptName), + m_dirs(directories), + debug(debugCmd), + ui(new Ui::ExtScript) { m_name = m_fileName; readConfiguration(); @@ -292,6 +292,8 @@ ExtScript::ScriptData ExtScript::run(const int time) if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmdList.join(QChar(' ')); TaskResult process = runTask(cmdList.join(QChar(' '))); if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; + if (process.exitCode != 0) + if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error; QString info = QString::number(process.exitCode) + QString(":") + QTextCodec::codecForMib(106)->toUnicode(process.error).trimmed(); diff --git a/sources/extsysmon/extsysmon.cpp b/sources/extsysmon/extsysmon.cpp index 65a3f4d..edd0b3c 100644 --- a/sources/extsysmon/extsysmon.cpp +++ b/sources/extsysmon/extsysmon.cpp @@ -30,10 +30,12 @@ #include #include -#include #include #include -#include + +#include "extscript.h" +#include "extupgrade.h" +#include "version.h" // KF5-KDE4 compability #ifdef BUILD_KDE4 @@ -57,6 +59,7 @@ ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList &args) setMinimumPollingInterval(333); readConfiguration(); initScripts(); + initUpgrade(); } @@ -101,6 +104,9 @@ QString ExtendedSysMon::getAutoMpris() QString cmd = QString("bash -c \"qdbus 'org.mpris.MediaPlayer2.*'\""); if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd; TaskResult process = runTask(cmd); + if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; + if (process.exitCode != 0) + if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error; QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed(); if (qoutput.split(QChar('\n'))[0].split(QChar('.')).count() > 3) @@ -119,20 +125,61 @@ void ExtendedSysMon::initScripts() QString localDir; QStringList dirs; #ifdef BUILD_KDE4 - localDir = KStandardDirs::locateLocal("data", "plasma_engine_extsysmon/scripts"); + localDir = KStandardDirs::locateLocal("data", "plasma_dataengine_extsysmon/scripts"); if (KStandardDirs::makeDir(localDir)) if (debug) qDebug() << PDEBUG << ":" << "Created directory" << localDir; - dirs = KGlobal::dirs()->findDirs("data", "plasma_engine_extsysmon/scripts"); + dirs = KGlobal::dirs()->findDirs("data", "plasma_dataengine_extsysmon/scripts"); #else localDir = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + - QString("/plasma_engine_extsysmon/scripts"); + QString("/plasma_dataengine_extsysmon/scripts"); QDir localDirectory; if ((!localDirectory.exists(localDir)) && (localDirectory.mkpath(localDir))) if (debug) qDebug() << PDEBUG << ":" << "Created directory" << localDir; dirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, - QString("plasma_engine_extsysmon/scripts"), + QString("plasma_dataengine_extsysmon/scripts"), + QStandardPaths::LocateDirectory); +#endif /* BUILD_KDE4 */ + + times.clear(); + QStringList names; + for (int i=0; ifindDirs("data", "plasma_dataengine_extsysmon/upgrade"); +#else + localDir = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + + QString("/plasma_dataengine_extsysmon/upgrade"); + QDir localDirectory; + if ((!localDirectory.exists(localDir)) && (localDirectory.mkpath(localDir))) + if (debug) qDebug() << PDEBUG << ":" << "Created directory" << localDir; + + dirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, + QString("plasma_dataengine_extsysmon/upgrade"), QStandardPaths::LocateDirectory); #endif /* BUILD_KDE4 */ @@ -144,8 +191,7 @@ void ExtendedSysMon::initScripts() if (names.contains(files[j])) continue; if (debug) qDebug() << PDEBUG << ":" << "Found file" << files[j] << "in" << dirs[i]; names.append(files[j]); - externalScripts.append(new ExtScript(0, files[j], dirs, debug)); - times.append(1); + externalUpgrade.append(new ExtUpgrade(0, files[j], dirs, debug)); } } } @@ -195,8 +241,6 @@ void ExtendedSysMon::readConfiguration() rawConfig[QString("MPDADDRESS")] = settings.value(QString("MPDADDRESS"), QString("localhost")).toString(); rawConfig[QString("MPDPORT")] = settings.value(QString("MPDPORT"), QString("6600")).toString(); rawConfig[QString("MPRIS")] = settings.value(QString("MPRIS"), QString("auto")).toString(); - rawConfig[QString("PKGCMD")] = settings.value(QString("PKGCMD"), QString("pacman -Qu")).toString(); - rawConfig[QString("PKGNULL")] = settings.value(QString("PKGNULL"), QString("0")).toString(); rawConfig[QString("PLAYER")] = settings.value(QString("PLAYER"), QString("mpris")).toString(); settings.endGroup(); @@ -234,11 +278,6 @@ QMap ExtendedSysMon::updateConfiguration(QMaptoUnicode(process.output).trimmed(); if (configuration[QString("GPUDEV")] == QString("nvidia")) @@ -369,6 +410,8 @@ float ExtendedSysMon::getGpuTemp(const QString device) if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd; TaskResult process = runTask(QString("bash -c \"") + cmd + QString("\"")); if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; + if (process.exitCode != 0) + if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error; QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output); if (configuration[QString("GPUDEV")] == QString("nvidia")) @@ -402,6 +445,8 @@ float ExtendedSysMon::getHddTemp(const QString cmd, const QString device) float value = 0.0; TaskResult process = runTask(cmd + QString(" ") + device); if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; + if (process.exitCode != 0) + if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error; QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed(); if (qoutput.split(QChar(':'), QString::SkipEmptyParts).count() >= 3) { @@ -465,6 +510,8 @@ QMap ExtendedSysMon::getPlayerInfo(const QString playerName, if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd; TaskResult process = runTask(cmd); if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; + if (process.exitCode != 0) + if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error; QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed(); QString qstr = QString(""); @@ -515,6 +562,8 @@ QMap ExtendedSysMon::getPsStats() if (debug) qDebug() << PDEBUG << ":" << "Run cmd" << cmd; TaskResult process = runTask(cmd); if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; + if (process.exitCode != 0) + if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error; qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed(); QStringList psList; @@ -528,6 +577,8 @@ QMap ExtendedSysMon::getPsStats() if (debug) qDebug() << PDEBUG << ":" << "Run cmd" << cmd; process = runTask(cmd); if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; + if (process.exitCode != 0) + if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error; qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed(); psStats[QString("pstotal")] = qoutput.split(QChar('\n'), QString::SkipEmptyParts).count(); @@ -536,20 +587,6 @@ QMap ExtendedSysMon::getPsStats() } -int ExtendedSysMon::getUpgradeInfo(const QString cmd) -{ - if (debug) qDebug() << PDEBUG; - if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd; - - TaskResult process = runTask(QString("bash -c \"") + cmd + QString("\"")); - if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; - - QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed(); - - return qoutput.split(QChar('\n'), QString::SkipEmptyParts).count(); -} - - bool ExtendedSysMon::sourceRequestEvent(const QString &source) { if (debug) qDebug() << PDEBUG; @@ -586,9 +623,9 @@ bool ExtendedSysMon::updateSourceEvent(const QString &source) for (int i=0; i MSEC_IN_HOUR) { - for (int i=0; irun()); pkgTimeUpdate = 0; } pkgTimeUpdate++; diff --git a/sources/extsysmon/extsysmon.h b/sources/extsysmon/extsysmon.h index b054ee4..f416378 100644 --- a/sources/extsysmon/extsysmon.h +++ b/sources/extsysmon/extsysmon.h @@ -27,6 +27,7 @@ class ExtScript; +class ExtUpgrade; class ExtendedSysMon : public Plasma::DataEngine { @@ -46,7 +47,6 @@ public: const QString mpdPort = 0, QString mpris = 0); QMap getPsStats(); - int getUpgradeInfo(const QString cmd); protected: bool sourceRequestEvent(const QString &source); @@ -57,6 +57,7 @@ private: // configuration QMap configuration; QList externalScripts; + QList externalUpgrade; QList times; bool debug; // FIXME dirty hack to avoid update package information every second @@ -66,6 +67,7 @@ private: QString getAutoGpu(); QString getAutoMpris(); void initScripts(); + void initUpgrade(); void readConfiguration(); QMap updateConfiguration(QMap rawConfig); }; diff --git a/sources/extsysmon/extupgrade.cpp b/sources/extsysmon/extupgrade.cpp new file mode 100644 index 0000000..3431f7d --- /dev/null +++ b/sources/extsysmon/extupgrade.cpp @@ -0,0 +1,253 @@ +/*************************************************************************** + * This file is part of awesome-widgets * + * * + * awesome-widgets is free software: you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * awesome-widgets is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with awesome-widgets. If not, see http://www.gnu.org/licenses/ * + ***************************************************************************/ + +#include "extupgrade.h" +#include "ui_extupgrade.h" + +#include +#include +#include +#include + +#include +#include + +#include "version.h" + + +ExtUpgrade::ExtUpgrade(QWidget *parent, const QString upgradeName, const QStringList directories, const bool debugCmd) : + QDialog(parent), + m_fileName(upgradeName), + m_dirs(directories), + debug(debugCmd), + ui(new Ui::ExtUpgrade) +{ + m_name = m_fileName; + readConfiguration(); + ui->setupUi(this); +} + + +ExtUpgrade::~ExtUpgrade() +{ + if (debug) qDebug() << PDEBUG; + + delete ui; +} + + +int ExtUpgrade::apiVersion() +{ + if (debug) qDebug() << PDEBUG; + + return m_apiVersion; +} + + +QString ExtUpgrade::comment() +{ + if (debug) qDebug() << PDEBUG; + + return m_comment; +} + + +QString ExtUpgrade::executable() +{ + if (debug) qDebug() << PDEBUG; + + return m_executable; +} + + +QString ExtUpgrade::fileName() +{ + if (debug) qDebug() << PDEBUG; + + return m_fileName; +} + + +QString ExtUpgrade::name() +{ + if (debug) qDebug() << PDEBUG; + + return m_name; +} + + +int ExtUpgrade::null() +{ + if (debug) qDebug() << PDEBUG; + + return m_null; +} + + +bool ExtUpgrade::isActive() +{ + if (debug) qDebug() << PDEBUG; + + return m_active; +} + + +void ExtUpgrade::setApiVersion(const int _apiVersion) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Version" << _apiVersion; + + m_apiVersion = _apiVersion; +} + + +void ExtUpgrade::setActive(const bool state) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "State" << state; + + m_active = state; +} + + +void ExtUpgrade::setComment(const QString _comment) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Comment" << _comment; + + m_comment = _comment; +} + + +void ExtUpgrade::setExecutable(const QString _executable) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Executable" << _executable; + + m_executable = _executable; +} + + +void ExtUpgrade::setName(const QString _name) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Name" << _name; + + m_name = _name; +} + + +void ExtUpgrade::setNull(const int _null) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Null lines" << _null; + if (_null < 0) return; + + m_null = _null; +} + + +void ExtUpgrade::readConfiguration() +{ + if (debug) qDebug() << PDEBUG; + + for (int i=m_dirs.count()-1; i>=0; i--) { + if (!QDir(m_dirs[i]).entryList(QDir::Files).contains(m_fileName)) continue; + QSettings settings(m_dirs[i] + QDir::separator() + m_fileName, QSettings::IniFormat); + + settings.beginGroup(QString("Desktop Entry")); + setName(settings.value(QString("Name"), m_name).toString()); + setComment(settings.value(QString("Comment"), m_comment).toString()); + setApiVersion(settings.value(QString("X-AW-ApiVersion"), AWESAPI).toInt()); + setExecutable(settings.value(QString("Exec"), m_executable).toString()); + setActive(settings.value(QString("X-AW-Active"), QVariant(m_active)).toString() == QString("true")); + setNull(settings.value(QString("X-AW-Null"), m_null).toInt()); + settings.endGroup(); + } +} + + +int ExtUpgrade::run() +{ + if (debug) qDebug() << PDEBUG; + + TaskResult process = runTask(QString("bash -c \"") + m_executable + QString("\"")); + if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; + if (process.exitCode != 0) + if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error; + + QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed(); + + return (qoutput.split(QChar('\n'), QString::SkipEmptyParts).count() - m_null); +} + + +void ExtUpgrade::showConfiguration() +{ + if (debug) qDebug() << PDEBUG; + + ui->lineEdit_name->setText(m_name); + ui->lineEdit_comment->setText(m_comment); + ui->lineEdit_command->setText(m_executable); + if (m_active) + ui->checkBox_active->setCheckState(Qt::Checked); + else + ui->checkBox_active->setCheckState(Qt::Unchecked); + ui->spinBox_null->setValue(m_null); + + int ret = exec(); + if (ret != 1) return; + setName(ui->lineEdit_name->text()); + setComment(ui->lineEdit_comment->text()); + setApiVersion(AWEUAPI); + setExecutable(ui->lineEdit_command->text()); + setActive(ui->checkBox_active->checkState() == Qt::Checked); + setNull(ui->spinBox_null->value()); + + writeConfiguration(); +} + + +void ExtUpgrade::tryDelete() +{ + if (debug) qDebug() << PDEBUG; + + for (int i=0; i + + +namespace Ui { +class ExtUpgrade; +} + +class ExtUpgrade : public QDialog +{ + Q_OBJECT + Q_PROPERTY(int apiVersion READ apiVersion WRITE setApiVersion) + Q_PROPERTY(QString name READ name WRITE setName) + Q_PROPERTY(QString comment READ comment WRITE setComment) + Q_PROPERTY(QString executable READ executable WRITE setExecutable) + Q_PROPERTY(int null READ null WRITE setNull) + Q_PROPERTY(bool active READ isActive WRITE setActive) + +public: + explicit ExtUpgrade(QWidget *parent = 0, const QString upgradeName = QString(), + const QStringList directories = QStringList(), const bool debugCmd = false); + ~ExtUpgrade(); + // get methods + int apiVersion(); + QString comment(); + QString executable(); + QString fileName(); + QString name(); + int null(); + bool isActive(); + // set methods + void setApiVersion(const int _apiVersion = 0); + void setActive(const bool _state = true); + void setComment(const QString _comment = QString("empty")); + void setExecutable(const QString _executable = QString("/usr/bin/true")); + void setName(const QString _name = QString("none")); + void setNull(const int _null = 0); + +public slots: + void readConfiguration(); + int run(); + void showConfiguration(); + void tryDelete(); + void writeConfiguration(); + +private: + QString m_fileName; + QStringList m_dirs; + bool debug; + Ui::ExtUpgrade *ui; + // properties + int m_apiVersion = 0; + bool m_active = true; + QString m_comment = QString("empty"); + QString m_executable = QString("/usr/bin/true"); + QString m_name = QString("none"); + int m_null = 0; +}; + + +#endif /* EXTUPGRADE_H */ diff --git a/sources/extsysmon/extupgrade.ui b/sources/extsysmon/extupgrade.ui new file mode 100644 index 0000000..30adc57 --- /dev/null +++ b/sources/extsysmon/extupgrade.ui @@ -0,0 +1,200 @@ + + + ExtUpgrade + + + + 0 + 0 + 420 + 301 + + + + Configuration + + + + + + + + + 0 + 0 + + + + Name + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + + + 0 + 0 + + + + Comment + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + + + 0 + 0 + + + + Command + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Active + + + + + + + + + + + Null + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 0 + + + 0 + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + ExtUpgrade + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ExtUpgrade + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/sources/extsysmon/plasma-dataengine-extsysmon.conf b/sources/extsysmon/plasma-dataengine-extsysmon.conf index 3be0d45..64a36e4 100644 --- a/sources/extsysmon/plasma-dataengine-extsysmon.conf +++ b/sources/extsysmon/plasma-dataengine-extsysmon.conf @@ -14,17 +14,5 @@ MPDPORT=6600 # MPRIS player name or 'auto'. In the most cases it should be a player name ## DBus path is org.mpris.MediaPlayer2.amarok MPRIS=auto -# Package upgrade info -## from vicious -## Arch: PKGCMD=pacman -Qu PKGNULL=0 -## Debian: PKGCMD=apt-show-versions -u -b PKGNULL=0 -## Ubuntu: PKGCMD=aptitude search '~U' PKGNULL=0 -## Fedora: PKGCMD=yum list updates PKGNULL=3 -## FreeBSD: PKGCMD=pkg_version -I -l '<' PKGNULL=0 -## Mandriva: PKGCMD=urpmq --auto-select PKGNULL=0 -## Commands to run, comma separated -PKGCMD=pacman -Qu -## Number of null lines for commands, comma separated -PKGNULL=0 # Player name. Supported players are 'mpd', 'mpris' PLAYER=mpris diff --git a/sources/extsysmon/plasma-dataengine-extsysmon.desktop b/sources/extsysmon/plasma-dataengine-extsysmon.desktop index bb2910b..f636aaf 100644 --- a/sources/extsysmon/plasma-dataengine-extsysmon.desktop +++ b/sources/extsysmon/plasma-dataengine-extsysmon.desktop @@ -7,7 +7,7 @@ Type=Service Icon=utilities-system-monitor X-KDE-ServiceTypes=Plasma/DataEngine -X-KDE-Library=plasma_engine_extsysmon +X-KDE-Library=plasma_dataengine_extsysmon X-Plasma-EngineName=extsysmon X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis diff --git a/sources/extsysmon/scripts/get-external-ip.desktop b/sources/extsysmon/scripts/get-external-ip.desktop index 5d9d860..636e817 100644 --- a/sources/extsysmon/scripts/get-external-ip.desktop +++ b/sources/extsysmon/scripts/get-external-ip.desktop @@ -8,3 +8,4 @@ X-AW-Active=true X-AW-Output=true X-AW-Redirect=nothing X-AW-Interval=1 +X-AW-ApiVersion=1 diff --git a/sources/extsysmon/scripts/script-template.desktop b/sources/extsysmon/scripts/script-template.desktop index 43a26a5..e951eb0 100644 --- a/sources/extsysmon/scripts/script-template.desktop +++ b/sources/extsysmon/scripts/script-template.desktop @@ -16,3 +16,5 @@ X-AW-Output=false X-AW-Redirect=nothing # update interval in default AW intervals X-AW-Interval=1 +# API version +X-AW-ApiVersion=1 diff --git a/sources/extsysmon/upgrade/default-arch.desktop b/sources/extsysmon/upgrade/default-arch.desktop new file mode 100644 index 0000000..955162c --- /dev/null +++ b/sources/extsysmon/upgrade/default-arch.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=default-arch +Comment=Archlinux upgrade info +Exec=pacman -Qu +X-AW-Prefix= +X-AW-Active=false +X-AW-Null=0 +X-AW-ApiVersion=1 diff --git a/sources/extsysmon/upgrade/default-debian.desktop b/sources/extsysmon/upgrade/default-debian.desktop new file mode 100644 index 0000000..383c396 --- /dev/null +++ b/sources/extsysmon/upgrade/default-debian.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=default-debian +Comment=Debian upgrade info +Exec=apt-show-versions -u -b +X-AW-Prefix= +X-AW-Active=false +X-AW-Null=0 +X-AW-ApiVersion=1 diff --git a/sources/extsysmon/upgrade/default-fedora.desktop b/sources/extsysmon/upgrade/default-fedora.desktop new file mode 100644 index 0000000..f1ededf --- /dev/null +++ b/sources/extsysmon/upgrade/default-fedora.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=default-fedora +Comment=Fedora upgrade info +Exec=yum list updates +X-AW-Prefix= +X-AW-Active=false +X-AW-Null=3 +X-AW-ApiVersion=1 diff --git a/sources/extsysmon/upgrade/default-mandriva.desktop b/sources/extsysmon/upgrade/default-mandriva.desktop new file mode 100644 index 0000000..767fed7 --- /dev/null +++ b/sources/extsysmon/upgrade/default-mandriva.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=default-mandriva +Comment=Mandriva upgrade info +Exec=urpmq --auto-select +X-AW-Prefix= +X-AW-Active=false +X-AW-Null=0 +X-AW-ApiVersion=1 diff --git a/sources/extsysmon/upgrade/default-ubuntu.desktop b/sources/extsysmon/upgrade/default-ubuntu.desktop new file mode 100644 index 0000000..76ba0b6 --- /dev/null +++ b/sources/extsysmon/upgrade/default-ubuntu.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=default-ubuntu +Comment=Ubuntu upgrade info +Exec=aptitude search '~U' +X-AW-Prefix= +X-AW-Active=false +X-AW-Null=0 +X-AW-ApiVersion=1 diff --git a/sources/version.h.in b/sources/version.h.in index 2fe23a3..fb2fec4 100644 --- a/sources/version.h.in +++ b/sources/version.h.in @@ -11,6 +11,7 @@ #define TRDPARTY_LICENSE "tasks,BSD,https://github.com/mhogomchungu/tasks" #define AWGIAPI 1 #define AWESAPI 1 +#define AWEUAPI 1 // links #define HOMEPAGE "http://arcanis.name/projects/awesome-widgets/"