Skip to content

Commit

Permalink
release 1.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
arcan1s committed May 7, 2014
1 parent 4857c66 commit 962478a
Show file tree
Hide file tree
Showing 15 changed files with 621 additions and 594 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Ver.1.8.2:
+ added different temperature units (Farenheit and Kelvin)

Ver.1.8.1:
* change pkg update time to hour

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG-RU
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Вер.1.8.2:
+ добавлены различные температурные единицы (Farenheit и Kelvin)

Вер.1.8.1:
* поле pkg теперь обновляется раз в час

Expand Down
4 changes: 2 additions & 2 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pkgname=kdeplasma-applets-pytextmonitor
_pkgname=pytextmonitor
pkgver=1.8.1
pkgver=1.8.2
pkgrel=1
pkgdesc="Minimalistic Plasmoid script written on Python2. It looks like widgets in Awesome WM"
arch=('i686' 'x86_64')
Expand All @@ -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=('de872b28c48b9b4903dcfa50158595dc')
md5sums=('2d5f5a2587c32cce3721ea217564a4ec')
backup=('usr/share/config/extsysmon.conf')

prepare() {
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ Advanced settings
* tag `$mm` - uptime minutes
* tag `$m` - uptime minutes without zero

**Temperature units**

Select units for temperature. Available units are Celsius, Farenheit and Kelvin.

**Temperature devices**

List of devices, which will be observed in temp label (combo box items come from `sensors`). List widget is editable, delete key will remove current item.
Expand Down
4 changes: 4 additions & 0 deletions readme/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ Advanced settings
* tag `$mm` - uptime minutes
* tag `$m` - uptime minutes without zero

**Temperature units**

Select units for temperature. Available units are Celsius, Farenheit and Kelvin.

**Temperature devices**

List of devices, which will be observed in temp label (combo box items come from `sensors`). List widget is editable, delete key will remove current item.
Expand Down
4 changes: 4 additions & 0 deletions readme/ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ PyTextMonitor - минималистичный плазмоид, написан
* тег `$mm` - минуты аптайма
* тег `$m` - минуты аптайма без нуля

**Температурные единицы**

Выберете единицы температуры. Доступные единицы следующие: Цельсий, Фаренгейт и Кельвин.

**Датчики температуры**

Список датчиков, которые будут наблюдаться в поле temo (содержимое комбо бокса берется из `sensors`). Виджет редактируем, клавиша delete удалит текущую строку.
Expand Down
2 changes: 1 addition & 1 deletion sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cmake_policy (SET CMP0015 NEW)
project (pytextmonitor)
set (PROJECT_VERSION_MAJOR 1)
set (PROJECT_VERSION_MINOR 8)
set (PROJECT_VERSION_PATCH 1)
set (PROJECT_VERSION_PATCH 2)
set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})

message (STATUS "Version: ${PROJECT_VERSION}")
Expand Down
3 changes: 3 additions & 0 deletions sources/ptm/contents/code/configdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def configAccepted(self):

settings.set('custom_time', str(self.configpage.ui.lineEdit_timeFormat.text()))
settings.set('custom_uptime', str(self.configpage.ui.lineEdit_uptimeFormat.text()))
settings.set('temp_units', str(self.configpage.ui.comboBox_tempUnits.currentText()))
item = QStringList()
for i in range(self.configpage.ui.listWidget_tempDevice.count()):
item.append(self.configpage.ui.listWidget_tempDevice.item(i).text())
Expand Down Expand Up @@ -133,6 +134,8 @@ def createConfigurationInterface(self, parent):

self.configpage.ui.lineEdit_timeFormat.setText(str(settings.get('custom_time', '$hh:$mm')))
self.configpage.ui.lineEdit_uptimeFormat.setText(str(settings.get('custom_uptime', '$ds,$hs,$ms')))
index = self.configpage.ui.comboBox_tempUnits.findText(str(settings.get('temp_units', "Celsius")))
self.configpage.ui.comboBox_tempUnits.setCurrentIndex(index)
commandOut = commands.getoutput("sensors")
for item in commandOut.split("\n\n"):
for device in item.split("\n"):
Expand Down
17 changes: 14 additions & 3 deletions sources/ptm/contents/code/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@
from util import *


def getTemp(temp, unit):
"""function to return temperature"""
if (unit == "Celsius"):
pass
elif (unit == "Fahrenheit"):
temp = str(round(((float(temp) * 9.0 / 5.0) + 32.0), 1))
elif (unit == "Kelvin"):
temp = str(round((float(temp) + 273.15), 1))
return temp



class CustomPlasmaLabel(Plasma.Label):
"""new Label with defined clicked() event"""
Expand Down Expand Up @@ -374,7 +385,7 @@ def hddtempText(self):
for i in devices:
if (line.split('$hddtemp' + str(i))[0] != line):
line = line.split('$hddtemp' + str(i))[0] +\
str(self.ptm['values']['hddtemp'][self.ptm['names']['hddtemp'][i]]) +\
getTemp(str(self.ptm['values']['hddtemp'][self.ptm['names']['hddtemp'][i]]), self.ptm['vars']['adv']['tempUnit']) +\
line.split('$hddtemp' + str(i))[1]
text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
self.setText("hddtemp", text)
Expand Down Expand Up @@ -443,7 +454,7 @@ def tempText(self):
for i in devices:
if (line.split('$temp' + str(i))[0] != line):
line = line.split('$temp' + str(i))[0] +\
str(self.ptm['values']['temp'][self.ptm['names']['temp'][i]]) +\
getTemp(str(self.ptm['values']['temp'][self.ptm['names']['temp'][i]]), self.ptm['vars']['adv']['tempUnits']) +\
line.split('$temp' + str(i))[1]
text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
self.setText("temp", text)
Expand Down Expand Up @@ -540,7 +551,7 @@ def textPrepare(self, name=None, text=None):
line = line.split('$gpu')[0] + text + line.split('$gpu')[1]
elif (name == "gputemp"):
if (line.split('$gputemp')[0] != line):
line = line.split('$gputemp')[0] + text + line.split('$gputemp')[1]
line = line.split('$gputemp')[0] + getTemp(text, self.ptm['vars']['adv']['tempUnits']) + line.split('$gputemp')[1]
elif (name == "pkg"):
for item in text.keys():
if (line.split('$' + item)[0] != line):
Expand Down
1 change: 1 addition & 0 deletions sources/ptm/contents/code/reinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def reinit(self):
ptmVars['adv']['acDev'] = str(settings.get('ac_device', '/sys/class/power_supply/AC/online'))
ptmVars['adv']['acOnline'] = str(settings.get('ac_online', '(*)'))
ptmVars['adv']['acOffline'] = str(settings.get('ac_offline', '( )'))
ptmVars['adv']['tempUnits'] = str(settings.get('temp_units', 'Celsius'))
ptmVars['adv']['batDev'] = str(settings.get('battery_device', '/sys/class/power_supply/BAT0/capacity'))
ptmVars['adv']['customTime'] = str(settings.get('custom_time', '$hh:$mm'))
ptmVars['adv']['customUptime'] = str(settings.get('custom_uptime', '$dd,$hh,$mm'))
Expand Down
86 changes: 73 additions & 13 deletions sources/ptm/contents/ui/configwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1131,9 +1131,9 @@ $ps - list of running processes comma separated</string>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>328</width>
<height>611</height>
<y>-102</y>
<width>526</width>
<height>642</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
Expand Down Expand Up @@ -1211,6 +1211,61 @@ $m - uptime minutes without zero</string>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_tempUnits">
<item>
<widget class="QLabel" name="label_tempUnits">
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Temperature units</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_tempUnits">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="comboBox_tempUnits">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<item>
<property name="text">
<string notr="true">Celsius</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">Fahrenheit</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">Kelvin</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="layout_tempDevice">
<item>
Expand Down Expand Up @@ -1578,17 +1633,17 @@ del - remove item</string>
</property>
<item>
<property name="text">
<string>amarok</string>
<string notr="true">amarok</string>
</property>
</item>
<item>
<property name="text">
<string>mpd</string>
<string notr="true">mpd</string>
</property>
</item>
<item>
<property name="text">
<string>qmmp</string>
<string notr="true">qmmp</string>
</property>
</item>
</widget>
Expand Down Expand Up @@ -1642,8 +1697,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">
Expand Down Expand Up @@ -1976,8 +2031,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">
Expand Down Expand Up @@ -2373,17 +2428,17 @@ del - remove item</string>
</property>
<item>
<property name="text">
<string>auto</string>
<string notr="true">auto</string>
</property>
</item>
<item>
<property name="text">
<string>nvidia</string>
<string notr="true">nvidia</string>
</property>
</item>
<item>
<property name="text">
<string>ati</string>
<string notr="true">ati</string>
</property>
</item>
</widget>
Expand Down Expand Up @@ -2704,6 +2759,7 @@ del - remove item</string>
<tabstop>scrollArea_advanced</tabstop>
<tabstop>lineEdit_timeFormat</tabstop>
<tabstop>lineEdit_uptimeFormat</tabstop>
<tabstop>comboBox_tempUnits</tabstop>
<tabstop>comboBox_tempDevice</tabstop>
<tabstop>pushButton_tempDevice</tabstop>
<tabstop>listWidget_tempDevice</tabstop>
Expand Down Expand Up @@ -2742,6 +2798,10 @@ del - remove item</string>
<tabstop>comboBox_hdddev</tabstop>
<tabstop>lineEdit_mpdaddress</tabstop>
<tabstop>spinBox_mpdport</tabstop>
<tabstop>comboBox_pkgCommand</tabstop>
<tabstop>spinBox_pkgCommandNum</tabstop>
<tabstop>pushButton_pkgCommand</tabstop>
<tabstop>listWidget_pkgCommand</tabstop>
</tabstops>
<resources/>
<connections/>
Expand Down
Loading

0 comments on commit 962478a

Please sign in to comment.