diff --git a/.gitignore b/.gitignore index 2a630fd..2475d22 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ sources/build sources/usr -*-src.tar.xz +*src.tar.xz +*src.tar.gz diff --git a/CHANGELOG b/CHANGELOG index 340073f..8ba6aad 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ Ver.1.8.0: + added $hddmbN, %hddgbN tags + added support of ps ($ps, $pscount, $pstotal tags) + added support of package managers ($pkgcountN tags) +* refactoring of DataEngine Ver.1.7.4: + added support more than 10 tags in cpu, cpuclock, hdd, hddtemp, temp labels diff --git a/CHANGELOG-RU b/CHANGELOG-RU index 96a2120..7aa9738 100644 --- a/CHANGELOG-RU +++ b/CHANGELOG-RU @@ -4,6 +4,7 @@ + добавлены теги $hddmbN, $hddgbN + добавлена поддержка ps (теги $ps, $pscount, $pstotal) + добавлена поддержка пакетных менеджеров (теги $pkgcountN) +* рефакторинг DataEngine Вер.1.7.4: + добавлена поддержка более чем 10 тэгов в полях cpu, cpuclock, hdd, hddtemp, temp diff --git a/PKGBUILD b/PKGBUILD index d419e31..d194b1e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,8 +2,8 @@ pkgname=kdeplasma-applets-pytextmonitor _pkgname=pytextmonitor -pkgver=1.7.4 -pkgrel=2 +pkgver=1.8.0 +pkgrel=1 pkgdesc="Minimalistic Plasmoid script written on Python2. It looks like widgets in Awesome WM" arch=('i686' 'x86_64') url="http://arcanis.name/projects/pytextmonitor" @@ -20,7 +20,7 @@ optdepends=("amarok: for music player monitor" makedepends=('automoc4' 'cmake') source=(https://github.com/arcan1s/pytextmonitor/releases/download/V.${pkgver}/${_pkgname}-${pkgver}-src.tar.xz) install=${pkgname}.install -md5sums=('b7ab42465a3c1f12719883d754e86a51') +md5sums=('9052985dc219e75ffbed88ce3ebf5a32') backup=('usr/share/config/extsysmon.conf') prepare() { diff --git a/readme/en.md b/readme/en.md index 19dde5e..694c01a 100644 --- a/readme/en.md +++ b/readme/en.md @@ -42,6 +42,10 @@ For edited output you must open Settings window and setup output format in lines * tag `$progress` - current song progress. One of supported music players must be installed * tag `$time` - current song duration. One of supported music players must be installed * tag `$title` - current song title. One of supported music players must be installed +* tag `$pscount` - number of running processes +* tag `$pstotal` - total number of processes +* tag `$ps` - list of running processes +* tag `$pkgcountN` - number of packages, which available to upgrade for command N. For example, `$pkgcount0` * tag `$custom` - returns output for custom command Label order will changed if you change slider position. HTML tags in label work normally. @@ -102,6 +106,14 @@ Use specified device as active. Combo box items come from **network directory**. File with battery information. File (`/sys/class/power_supply/BAT0/capacity` by default) should contain only battery charge in percent. +**AC online tag** + +Line which will be shown when AC is online. + +**AC offline tag** + +Line which will be shown when AC is offline. + **AC device** File with AC information. File (`/sys/class/power_supply/AC/online` by default) must contain `1` if AC is online. @@ -116,6 +128,12 @@ Since version 1.7.0 CPU, CPU clock, memory, swap and network labels support grap DataEngine settings ------------------- +**Custom command** + +*NOTE* This can cause the computer freeze. + +A command, which will be run for custom label. + **GPU device** Select one of supported GPU devices. `auto` will enable auto selection. Default is `auto`. @@ -132,11 +150,16 @@ Address of MPD server. Default is `localhost`. Port of MPD server. Default is `6600`. -**Custom command** +**Package manager** -*NOTE* This can cause the computer freeze. +List of commands, which will be run. Number of null lines is a number of unneeded lines. Defaults: +* *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` -A command, which will be run for custom label. DataEngine configuration ------------------------ @@ -182,6 +205,9 @@ Installation Additional information ====================== +TODO (wish list) +---------------- + Links ----- * [Homepage](http://arcanis.name/projects/pytextmonitor/) diff --git a/sources/ext-sysmon/extsysmon.h b/sources/ext-sysmon/extsysmon.h index 05d001e..eac0e7b 100644 --- a/sources/ext-sysmon/extsysmon.h +++ b/sources/ext-sysmon/extsysmon.h @@ -39,7 +39,6 @@ public: const int pkgNull = 0); protected: - void readConfiguration(); bool sourceRequestEvent(const QString &name); bool updateSourceEvent(const QString &source); QStringList sources() const; @@ -50,6 +49,7 @@ private: // reread configuration QString getAllHdd(); QString getAutoGpu(); + void readConfiguration(); QMap updateConfiguration(const QMap rawConfig); }; diff --git a/sources/ptm/contents/code/configdef.py b/sources/ptm/contents/code/configdef.py index 9aadfde..e214ec7 100644 --- a/sources/ptm/contents/code/configdef.py +++ b/sources/ptm/contents/code/configdef.py @@ -87,8 +87,12 @@ class ConfigDefinition: pkgCmd = [] pkgNull = [] for command in item: - pkgCmd.append(str(command.split(QString(":"))[0])) - pkgNull.append(str(command.split(QString(":"))[1])) + try: + pkgCmd.append(str(command.split(QString(":"))[0])) + pkgNull.append(str(command.split(QString(":"))[1])) + except: + pkgCmd.append(str(command)) + pkgNull.append("0") deConfigFile.write("PKGCMD=" + ','.join(pkgCmd) + "\n") deConfigFile.write("PKGNULL=" + ','.join(pkgNull) + "\n") except: