added cmake build

This commit is contained in:
arcan1s
2014-03-30 14:18:56 +04:00
parent e6bbea9c07
commit d66bafa816
42 changed files with 1347 additions and 113 deletions

View File

@ -0,0 +1,33 @@
# set project name
set (SUBPROJECT py-text-monitor)
# for notifications
set (PLUGIN_NAME plasma_applet_pytextmonitor)
message (STATUS "Subproject ${SUBPROJECT}")
# find required libaries
find_package (KDE4 REQUIRED)
include (KDE4Defaults)
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../)
add_subdirectory (po)
# set sources
set (SUBPROJECT_CODE_DIR "contents/code")
set (SUBPROJECT_UI_DIR "contents/ui")
file (GLOB SUBPROJECT_DESKTOP_IN *.desktop)
file (RELATIVE_PATH SUBPROJECT_DESKTOP ${CMAKE_SOURCE_DIR} ${SUBPROJECT_DESKTOP_IN})
file (GLOB SUBPROJECT_NOTIFY *.notifyrc)
file (GLOB SUBPROJECT_SOURCE ${SUBPROJECT_CODE_DIR}/*.py)
file (GLOB SUBPROJECT_UI ${SUBPROJECT_UI_DIR}/*.ui)
# prepare
configure_file (${SUBPROJECT_DESKTOP_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP})
# install
install (FILES ${SUBPROJECT_SOURCE} DESTINATION "share/apps/plasma/plasmoids/${SUBPROJECT}/${SUBPROJECT_CODE_DIR}")
install (FILES ${SUBPROJECT_UI} DESTINATION "share/apps/plasma/plasmoids/${SUBPROJECT}/${SUBPROJECT_UI_DIR}")
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR} RENAME ${SUBPROJECT}.desktop)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION "share/apps/plasma/plasmoids/${SUBPROJECT}")
install (FILES ${SUBPROJECT_NOTIFY} DESTINATION ${DATA_INSTALL_DIR}/${PLUGIN_NAME})

View File

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
# Copyright 2012 Alex Oleshkevich <alex.oleshkevich@gmail.com>
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from util import *
class Config():
def __init__(self, applet):
self.applet = applet
self.config = self.applet.config()
def get(self, key, default = ''):
return self.config.readEntry(key, default).toString()
def set(self, key, value):
self.config.writeEntry(key, value)

View File

@ -0,0 +1,223 @@
# -*- coding: utf-8 -*-
# Copyright 2013 Evgeniy Alekseev <esalexeev@gmail.com>
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from PyQt4.QtGui import *
from PyKDE4.kdecore import *
from PyKDE4.kdeui import *
import commands
import config
class ConfigDefinition:
def __init__(self, parent, configpage):
"""class definition"""
self.parent = parent
self.configpage = configpage
def configAccepted(self):
"""function to accept settings"""
settings = config.Config(self.parent)
# update local variables
self.parent.interval = self.configpage.ui.spinBox_interval.value()
settings.set('interval', self.parent.interval)
self.parent.font_family = str(self.configpage.ui.fontComboBox.currentFont().family())
settings.set('font_family', self.parent.font_family)
self.parent.font_size = self.configpage.ui.spinBox_fontSize.value()
settings.set('font_size', self.parent.font_size)
self.parent.font_color = str(self.configpage.ui.kcolorcombo.color().name())
settings.set('font_color', self.parent.font_color)
if (self.configpage.ui.comboBox_style.currentIndex() == 0):
self.parent.font_style = 'normal'
else:
self.parent.font_style = 'italic'
settings.set('font_style', self.parent.font_style)
self.parent.font_weight = self.configpage.ui.spinBox_weight.value()
settings.set('font_weight', self.parent.font_weight)
# disconnecting from source and clear layout
if (self.parent.uptimeBool > 0):
self.parent.systemmonitor.disconnectSource("system/uptime", self.parent)
self.parent.label_uptime.setText('')
self.parent.layout.removeItem(self.parent.label_uptime)
if (self.parent.cpuBool > 0):
self.parent.systemmonitor.disconnectSource("cpu/system/TotalLoad", self.parent)
if (self.parent.cpuFormat.split('$ccpu')[0] != self.parent.cpuFormat):
self.parent.label_cpu.setText('')
self.parent.layout.removeItem(self.parent.label_cpu)
self.parent.label_cpu1.setText('')
self.parent.layout.removeItem(self.parent.label_cpu1)
for core in range(self.parent.numCores):
self.parent.systemmonitor.disconnectSource("cpu/cpu"+str(core)+"/TotalLoad", self.parent)
exec ("self.parent.label_coreCpu" + str(core) + ".setText('')")
exec ("self.parent.layout.removeItem(self.parent.label_coreCpu" + str(core) + ")")
else:
self.parent.label_cpu.setText('')
self.parent.layout.removeItem(self.parent.label_cpu)
if (self.parent.cpuclockBool > 0):
self.parent.systemmonitor.disconnectSource("cpu/system/AverageClock", self.parent)
if (self.parent.cpuclockFormat.split('$ccpu')[0] != self.parent.cpuclockFormat):
self.parent.label_cpuclock.setText('')
self.parent.layout.removeItem(self.parent.label_cpuclock)
self.parent.label_cpuclock1.setText('')
self.parent.layout.removeItem(self.parent.label_cpuclock1)
for core in range(self.parent.numCores):
self.parent.systemmonitor.disconnectSource("cpu/cpu"+str(core)+"/clock", self.parent)
exec ("self.parent.label_coreCpuclock" + str(core) + ".setText('')")
exec ("self.parent.layout.removeItem(self.parent.label_coreCpuclock" + str(core) + ")")
else:
self.parent.label_cpuclock.setText('')
self.parent.layout.removeItem(self.parent.label_cpuclock)
if (self.parent.tempBool > 0):
self.parent.systemmonitor.disconnectSource(self.parent.tempdev, self.parent)
self.parent.label_temp.setText('')
self.parent.layout.removeItem(self.parent.label_temp)
if (self.parent.gpuBool > 0):
self.parent.extsysmon.disconnectSource("gpu", self.parent)
self.parent.label_gpu.setText('')
self.parent.layout.removeItem(self.parent.label_gpu)
if (self.parent.gputempBool > 0):
self.parent.extsysmon.disconnectSource("gputemp", self.parent)
self.parent.label_gputemp.setText('')
self.parent.layout.removeItem(self.parent.label_gputemp)
if (self.parent.memBool > 0):
self.parent.systemmonitor.disconnectSource("mem/physical/application", self.parent)
if (self.parent.memInMb == False):
self.parent.systemmonitor.disconnectSource("mem/physical/free", self.parent)
self.parent.systemmonitor.disconnectSource("mem/physical/used", self.parent)
self.parent.label_mem.setText('')
self.parent.layout.removeItem(self.parent.label_mem)
if (self.parent.swapBool > 0):
self.parent.systemmonitor.disconnectSource("mem/swap/used", self.parent)
if (self.parent.swapInMb == False):
self.parent.systemmonitor.disconnectSource("mem/swap/free", self.parent)
self.parent.label_swap.setText('')
self.parent.layout.removeItem(self.parent.label_swap)
if (self.parent.hddBool > 0):
for mount in self.parent.mountPoints:
self.parent.systemmonitor.disconnectSource("partitions" + mount + "/filllevel", self.parent)
exec ('self.parent.label_hdd_' + ''.join(mount.split('/')) + '.setText("")')
exec ("self.parent.layout.removeItem(self.parent.label_hdd_" + ''.join(mount.split('/')) + ")")
self.parent.label_hdd0.setText('')
self.parent.label_hdd1.setText('')
self.parent.layout.removeItem(self.parent.label_hdd0)
self.parent.layout.removeItem(self.parent.label_hdd1)
if (self.parent.hddtempBool > 0):
self.parent.extsysmon.disconnectSource("hddtemp", self.parent)
self.parent.label_hddtemp.setText('')
self.parent.layout.removeItem(self.parent.label_hddtemp)
if (self.parent.netBool > 0):
self.parent.systemmonitor.disconnectSource("network/interfaces/"+self.parent.netdev+"/transmitter/data", self.parent)
self.parent.systemmonitor.disconnectSource("network/interfaces/"+self.parent.netdev+"/receiver/data", self.parent)
self.parent.label_netDown.setText('')
self.parent.label_netUp.setText('')
self.parent.layout.removeItem(self.parent.label_netUp)
self.parent.layout.removeItem(self.parent.label_netDown)
if (self.parent.batBool > 0):
self.parent.label_bat.setText('')
self.parent.layout.removeItem(self.parent.label_bat)
if (self.parent.playerBool > 0):
self.parent.extsysmon.disconnectSource("player", self.parent)
self.parent.label_player.setText('')
self.parent.layout.removeItem(self.parent.label_player)
if (self.parent.timeBool > 0):
self.parent.timemon.disconnectSource("Local", self.parent)
self.parent.label_time.setText('')
self.parent.layout.removeItem(self.parent.label_time)
self.parent.label_order = "--------------"
for label in self.parent.dict_orders.keys():
exec ('self.parent.' + self.parent.dict_orders[label] + 'Bool = ' + str(self.configpage.checkboxes[self.parent.dict_orders[label]].checkState()))
if (self.configpage.checkboxes[self.parent.dict_orders[label]].checkState() > 0):
pos = self.configpage.sliders[self.parent.dict_orders[label]].value() - 1
self.parent.label_order = self.parent.label_order[:pos] + label + self.parent.label_order[pos+1:]
if (self.parent.dict_orders[label] == 'net'):
exec ('self.parent.' + self.parent.dict_orders[label] + 'NonFormat = str(self.configpage.lineedits[self.parent.dict_orders[label]].text())')
exec ('settings.set("' + self.parent.dict_orders[label] + 'NonFormat", self.parent.' + self.parent.dict_orders[label] + 'NonFormat)')
else:
exec ('self.parent.' + self.parent.dict_orders[label] + 'Format = str(self.configpage.lineedits[self.parent.dict_orders[label]].text())')
exec ('settings.set("' + self.parent.dict_orders[label] + 'Format", self.parent.' + self.parent.dict_orders[label] + 'Format)')
exec ('settings.set("' + self.parent.dict_orders[label] + 'Bool", self.parent.' + self.parent.dict_orders[label] + 'Bool)')
if (self.parent.dict_orders[label] == 'bat'):
self.parent.battery_device = str(self.configpage.ui.lineEdit_batdev.text())
self.parent.ac_device = str(self.configpage.ui.lineEdit_acdev.text())
settings.set('battery_device', self.parent.battery_device)
settings.set('ac_device', self.parent.ac_device)
elif (self.parent.dict_orders[label] == 'temp'):
self.parent.tempdev = str(self.configpage.ui.comboBox_temp.currentText())
settings.set('temp_device', self.parent.tempdev)
elif (self.parent.dict_orders[label] == 'player'):
self.parent.player_name = self.configpage.ui.comboBox_player.currentIndex()
settings.set('player_name', self.parent.player_name)
self.parent.label_order = ''.join(self.parent.label_order.split('-'))
settings.set('label_order', self.parent.label_order)
# reinitializate
self.parent.reinit.reinit(confAccept=True)
def createConfigurationInterface(self, parent):
"""function to setup configuration window"""
settings = config.Config(self.parent)
font = QFont(str(settings.get('font_family', 'Terminus')), settings.get('font_size', 12).toInt()[0], 400, False)
self.configpage.ui.spinBox_interval.setValue(settings.get('interval', 2000).toInt()[0])
self.configpage.ui.fontComboBox.setCurrentFont(font)
self.configpage.ui.spinBox_fontSize.setValue(settings.get('font_size', 12).toInt()[0])
self.configpage.ui.kcolorcombo.setColor(QColor(str(settings.get('font_color', '#000000'))))
font = str(settings.get('font_style', 'normal'))
if (font == 'normal'):
self.configpage.ui.comboBox_style.setCurrentIndex(0)
else:
self.configpage.ui.comboBox_style.setCurrentIndex(1)
self.configpage.ui.spinBox_weight.setValue(settings.get('font_weight', 400).toInt()[0])
for label in self.parent.dict_orders.keys():
exec ('bool = self.parent.' + self.parent.dict_orders[label] + 'Bool')
self.configpage.checkboxes[self.parent.dict_orders[label]].setCheckState(bool)
if (bool > 0):
self.configpage.sliders[self.parent.dict_orders[label]].setValue(self.parent.label_order.find(label)+1)
if (self.parent.dict_orders[label] == 'net'):
self.configpage.lineedits[self.parent.dict_orders[label]].setText(str(settings.get(self.parent.dict_orders[label] + 'NonFormat', self.parent.dict_defFormat[self.parent.dict_orders[label]])))
else:
self.configpage.lineedits[self.parent.dict_orders[label]].setText(str(settings.get(self.parent.dict_orders[label] + 'Format', self.parent.dict_defFormat[self.parent.dict_orders[label]])))
if (self.parent.dict_orders[label] == 'bat'):
self.configpage.ui.lineEdit_batdev.setText(str(settings.get('battery_device', '/sys/class/power_supply/BAT0/capacity')))
self.configpage.ui.lineEdit_acdev.setText(str(settings.get('ac_device', '/sys/class/power_supply/AC/online')))
elif (self.parent.dict_orders[label] == 'temp'):
self.configpage.ui.comboBox_temp.addItem(str(settings.get('temp_device', '<select device>')))
commandOut = commands.getoutput("sensors")
for adapter in commandOut.split("\n\n"):
for device in adapter.split("\n"):
if (device.find('\xc2\xb0C') > -1):
try:
tempdev = 'lmsensors/' + adapter.split('\n')[0] + '/' + '_'.join(device.split(":")[0].split())
self.configpage.ui.comboBox_temp.addItem(tempdev)
except:
pass
elif (self.parent.dict_orders[label] == 'player'):
self.configpage.ui.comboBox_player.setCurrentIndex(int(settings.get('player_name', 0)))
# add config page
page = parent.addPage(self.configpage, i18n(self.parent.name()))
page.setIcon(KIcon(self.parent.icon()))
parent.okClicked.connect(self.configAccepted)

View File

@ -0,0 +1,127 @@
# -*- coding: utf-8 -*-
# Copyright 2013 Evgeniy Alekseev <esalexeev@gmail.com>
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyKDE4.plasma import *
from PyQt4 import uic
from PyKDE4 import plasmascript
class ConfigWindow(QWidget):
def __init__(self, parent):
"""settings window definition"""
QWidget.__init__(self)
self.ui = uic.loadUi(parent.package().filePath('ui', 'configwindow.ui'), self)
self.parent = parent
self.checkboxes = {'bat':self.ui.checkBox_bat, 'cpu':self.ui.checkBox_cpu,
'cpuclock':self.ui.checkBox_cpuclock, 'gpu':self.ui.checkBox_gpu,
'gputemp':self.ui.checkBox_gpuTemp, '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, 'time':self.ui.checkBox_time}
self.sliders = {'bat':self.ui.slider_bat, 'cpu':self.ui.slider_cpu,
'cpuclock':self.ui.slider_cpuclock, 'gpu':self.ui.slider_gpu,
'gputemp':self.ui.slider_gpuTemp, '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, 'time':self.ui.slider_time}
self.lineedits = {'bat':self.ui.lineEdit_bat, 'cpu':self.ui.lineEdit_cpu,
'cpuclock':self.ui.lineEdit_cpuclock, 'gpu':self.ui.lineEdit_gpu,
'gputemp':self.ui.lineEdit_gpuTemp, '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, 'time':self.ui.lineEdit_time}
for item in self.checkboxes.values():
QObject.connect(item, SIGNAL("stateChanged(int)"), self.setStatus)
for item in self.sliders.values():
QObject.connect(item, SIGNAL("valueChanged(int)"), self.setSlider)
def setStatus(self):
"""function to enable label"""
count = self.sliders['bat'].maximum()
for label in self.checkboxes.keys():
if ((self.checkboxes[label].checkState() > 0) and (self.sliders[label].isEnabled() == False)):
self.lineedits[label].setEnabled(True)
self.sliders[label].setEnabled(True)
if (label == 'bat'):
self.ui.lineEdit_acdev.setEnabled(True)
self.ui.lineEdit_batdev.setEnabled(True)
elif (label == 'temp'):
self.ui.comboBox_temp.setEnabled(True)
elif (label == 'player'):
self.ui.comboBox_player.setEnabled(True)
slider_label = 0
for slider in self.sliders.values():
if (slider.isEnabled() == True):
slider_label += 1
for slider in self.sliders.values():
if (slider_label > 1):
slider.setMaximum(slider.maximum()+1)
elif (slider_label == 1):
slider.setMaximum(1)
self.sliders[label].setValue(self.sliders[label].maximum())
elif ((self.checkboxes[label].checkState() == 0) and (self.sliders[label].isEnabled() == True)):
self.lineedits[label].setDisabled(True)
self.sliders[label].setDisabled(True)
if (label == 'bat'):
self.ui.lineEdit_acdev.setDisabled(True)
self.ui.lineEdit_batdev.setDisabled(True)
elif (label == 'temp'):
self.ui.comboBox_temp.setDisabled(True)
elif (label == 'player'):
self.ui.comboBox_player.setDisabled(True)
for slider in self.sliders.values():
if ((slider.value() == slider.maximum()) and (slider != self.sliders[label])):
slider.setValue(self.sliders[label].value())
slider_label = 0
for slider in self.sliders.values():
if (slider.isEnabled() == True):
slider_label += 1
for slider in self.sliders.values():
if (slider_label > 0):
slider.setMaximum(slider.maximum()-1)
else:
slider.setMaximum(1)
self.sliders[label].setValue(1)
def setSlider(self):
"""function to set sliders"""
if (self.sender().isEnabled() == True):
second_slider = self.sender()
order = []
for slider in self.sliders.values():
if (slider.isEnabled() == True):
order.append(slider.value())
if ((slider.value() == self.sender().value()) and (slider != self.sender())):
second_slider = slider
if (second_slider == self.sender()):
return
for value in range(len(order)):
if (order.count(value+1) == 0):
new_value = value + 1
second_slider.setValue(new_value)

View File

@ -0,0 +1,344 @@
# -*- coding: utf-8 -*-
# Copyright 2013 Evgeniy Alekseev <esalexeev@gmail.com>
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyKDE4.plasma import Plasma
from PyKDE4 import plasmascript
import datetime
timeLetters = ['dddd', 'ddd', 'dd', 'd', \
'MMMM', 'MMM', 'MM', 'M', 'yyyy', 'yy', \
'hh', 'h', 'mm', 'm', 'ss', 's']
class DataEngine:
def __init__(self, parent):
"""class definition"""
self.parent = parent
def connectToEngine(self):
"""function to initializate engine"""
self.parent.systemmonitor = self.parent.dataEngine("systemmonitor")
if ((self.parent.gputempBool > 0) or (self.parent.gpuBool > 0) or (self.parent.hddtempBool > 0) or (self.parent.playerBool > 0)):
self.parent.extsysmon = self.parent.dataEngine("ext-sysmon")
if (self.parent.timeBool > 0):
self.parent.timemon = self.parent.dataEngine("time")
self.parent.timemon.connectSource("Local", self.parent, 1000)
if (self.parent.uptimeBool > 0):
self.parent.systemmonitor.connectSource("system/uptime", self.parent, self.parent.interval)
if (self.parent.cpuBool > 0):
self.parent.systemmonitor.connectSource("cpu/system/TotalLoad", self.parent, self.parent.interval)
if (self.parent.cpuFormat.split('$ccpu')[0] != self.parent.cpuFormat):
for core in range(self.parent.numCores):
self.parent.systemmonitor.connectSource("cpu/cpu"+str(core)+"/TotalLoad", self.parent, self.parent.interval)
if (self.parent.cpuclockBool > 0):
self.parent.systemmonitor.connectSource("cpu/system/AverageClock", self.parent, self.parent.interval)
if (self.parent.cpuclockFormat.split('$ccpucl')[0] != self.parent.cpuclockFormat):
for core in range(self.parent.numCores):
self.parent.systemmonitor.connectSource("cpu/cpu"+str(core)+"/clock", self.parent, self.parent.interval)
if (self.parent.tempBool > 0):
self.parent.systemmonitor.connectSource(self.parent.tempdev, self.parent, self.parent.interval)
if (self.parent.gpuBool > 0):
self.parent.extsysmon.connectSource("gpu", self.parent, self.parent.interval)
if (self.parent.gputempBool > 0):
self.parent.extsysmon.connectSource("gputemp", self.parent, self.parent.interval)
if (self.parent.memBool > 0):
if (self.parent.memInMb):
self.parent.systemmonitor.connectSource("mem/physical/application", self.parent, self.parent.interval)
else:
self.parent.systemmonitor.connectSource("mem/physical/free", self.parent, int(self.parent.interval*0.5))
self.parent.systemmonitor.connectSource("mem/physical/used", self.parent, int(self.parent.interval*0.5))
self.parent.systemmonitor.connectSource("mem/physical/application", self.parent, int(self.parent.interval*0.5))
if (self.parent.swapBool > 0):
if (self.parent.swapInMb):
self.parent.systemmonitor.connectSource("mem/swap/used", self.parent, self.parent.interval)
else:
self.parent.systemmonitor.connectSource("mem/swap/free", self.parent, int(self.parent.interval*0.5))
self.parent.systemmonitor.connectSource("mem/swap/used", self.parent, int(self.parent.interval*0.5))
if (self.parent.hddBool > 0):
for mount in self.parent.mountPoints:
self.parent.systemmonitor.connectSource("partitions" + mount + "/filllevel", self.parent, self.parent.interval)
if (self.parent.hddtempBool > 0):
self.parent.extsysmon.connectSource("hddtemp", self.parent, self.parent.interval)
if (self.parent.netBool > 0):
self.parent.updateNetdev = 0
self.parent.systemmonitor.connectSource("network/interfaces/"+self.parent.netdev+"/transmitter/data", self.parent, self.parent.interval)
self.parent.systemmonitor.connectSource("network/interfaces/"+self.parent.netdev+"/receiver/data", self.parent, self.parent.interval)
if (self.parent.playerBool > 0):
self.parent.extsysmon.connectSource("player", self.parent, self.parent.interval)
def dataUpdated(self, sourceName, data):
"""function to update data"""
#try:
if True:
if (sourceName == "system/uptime"):
value = datetime.timedelta(0, int(round(float(data[QString(u'value')]), 1)))
days = value.days
hours = int(value.seconds / 60 / 60)
minutes = int(value.seconds / 60 % 60)
line = self.parent.uptimeFormat
if (line.split('$uptime')[0] != line):
uptimeText = "%3id%2ih%2im" % (days, hours, minutes)
line = line.split('$uptime')[0] + uptimeText + line.split('$uptime')[1]
elif (line.split('$custom')[0] != line):
line = ''.join(line.split('$custom'))
if (line.split('$ds')[0] != line):
line = "%s%3i%s" % (line.split('$ds')[0], days, line.split('$ds')[1])
if (line.split('$hs')[0] != line):
line = "%s%2i%s" % (line.split('$hs')[0], hours, line.split('$hs')[1])
if (line.split('$ms')[0] != line):
line = "%s%2i%s" % (line.split('$ms')[0], minutes, line.split('$ms')[1])
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_uptime.setText(text)
elif (sourceName == "cpu/system/TotalLoad"):
value = str(round(float(data[QString(u'value')]), 1))
cpuText = "%5s" % (value)
if (self.parent.cpuFormat.split('$ccpu')[0] != self.parent.cpuFormat):
if (self.parent.cpuFormat.split('$ccpu')[0].split('$cpu')[0] != self.parent.cpuFormat.split('$ccpu')[0]):
line = self.parent.cpuFormat.split('$ccpu')[0].split('$cpu')[0] + cpuText + self.parent.cpuFormat.split('$ccpu')[0].split('$cpu')[1]
else:
line = self.parent.cpuFormat.split('$ccpu')[0]
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_cpu.setText(text)
if (self.parent.cpuFormat.split('$ccpu')[1].split('$cpu')[0] != self.parent.cpuFormat.split('$ccpu')[1]):
line = self.parent.cpuFormat.split('$ccpu')[1].split('$cpu')[0] + cpuText + self.parent.cpuFormat.split('$ccpu')[1].split('$cpu')[1]
else:
line = self.parent.cpuFormat.split('$ccpu')[1]
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_cpu1.setText(text)
else:
if (self.parent.cpuFormat.split('$cpu')[0] != self.parent.cpuFormat):
line = self.parent.cpuFormat.split('$cpu')[0] + cpuText + self.parent.cpuFormat.split('$cpu')[1]
else:
line = self.parent.cpuFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_cpu.setText(text)
elif ((str(sourceName)[:7] == "cpu/cpu") and (str(sourceName).split('/')[2] == "TotalLoad")):
value = str(round(float(data[QString(u'value')]), 1))
cpuText = "%5s" % (value)
text = self.parent.formatLine.split('$LINE')[0] + cpuText + self.parent.formatLine.split('$LINE')[1]
exec ('self.parent.label_coreCpu' + str(sourceName)[7] + '.setText(text)')
elif (sourceName == "cpu/system/AverageClock"):
value = str(data[QString(u'value')]).split('.')[0]
cpuclockText = "%4s" % (value)
if (self.parent.cpuclockFormat.split('$ccpucl')[0] != self.parent.cpuclockFormat):
if (self.parent.cpuclockFormat.split('$ccpucl')[0].split('$cpucl')[0] != self.parent.cpuclockFormat.split('$ccpucl')[0]):
line = self.parent.cpuclockFormat.split('$ccpucl')[0].split('$cpucl')[0] + cpuclockText + self.parent.cpuclockFormat.split('$ccpucl')[0].split('$cpucl')[1]
else:
line = self.parent.cpuclockFormat.split('$ccpucl')[0]
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_cpuclock.setText(text)
if (self.parent.cpuclockFormat.split('$ccpucl')[1].split('$cpucl')[0] != self.parent.cpuclockFormat.split('$ccpucl')[1]):
line = self.parent.cpuclockFormat.split('$ccpucl')[1].split('$cpucl')[0] + cpuclockText + self.parent.cpuclockFormat.split('$ccpucl')[1].split('$cpucl')[1]
else:
line = self.parent.cpuclockFormat.split('$ccpucl')[1]
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_cpuclock1.setText(text)
else:
if (self.parent.cpuclockFormat.split('$cpucl')[0] != self.parent.cpuclockFormat):
line = self.parent.cpuclockFormat.split('$cpucl')[0] + cpuclockText + self.parent.cpuclockFormat.split('$cpucl')[1]
else:
line = self.parent.cpuclockFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_cpuclock.setText(text)
elif ((str(sourceName)[:7] == "cpu/cpu") and (str(sourceName).split('/')[2] == "clock")):
value = str(data[QString(u'value')]).split('.')[0]
cpuclockText = "%4s" % (value)
text = self.parent.formatLine.split('$LINE')[0] + cpuclockText + self.parent.formatLine.split('$LINE')[1]
exec ('self.parent.label_coreCpuclock' + str(sourceName)[7] + '.setText(text)')
elif (sourceName == "network/interfaces/"+self.parent.netdev+"/transmitter/data"):
value = str(data[QString(u'value')]).split('.')[0]
up_speed = "%4s" % (value)
if (self.parent.netFormat.split('$net')[0] != self.parent.netFormat):
line = '/' + up_speed + self.parent.netFormat.split('$net')[1]
else:
line = ''
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_netUp.setText(text)
elif (sourceName == "network/interfaces/"+self.parent.netdev+"/receiver/data"):
value = str(data[QString(u'value')]).split('.')[0]
down_speed = "%4s" % (value)
if (self.parent.netFormat.split('$net')[0] != self.parent.netFormat):
line = self.parent.netFormat.split('$net')[0] + down_speed
else:
line = self.parent.netFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_netDown.setText(text)
# update network device
self.parent.updateNetdev = self.parent.updateNetdev + 1
if (self.parent.updateNetdev == 100):
self.parent.updateNetdev = 0
if (self.parent.netNonFormat.split('@@')[0] == self.parent.netNonFormat):
self.parent.systemmonitor.disconnectSource("network/interfaces/"+self.parent.netdev+"/transmitter/data", self.parent)
self.parent.systemmonitor.disconnectSource("network/interfaces/"+self.parent.netdev+"/receiver/data", self.parent)
self.parent.netdev = self.parent.setupNetdev()
self.parent.systemmonitor.connectSource("network/interfaces/"+self.parent.netdev+"/transmitter/data", self.parent, self.parent.interval)
self.parent.systemmonitor.connectSource("network/interfaces/"+self.parent.netdev+"/receiver/data", self.parent, self.parent.interval)
if (self.parent.netNonFormat.split('$netdev')[0] != self.parent.netNonFormat):
self.parent.netFormat = self.parent.netNonFormat.split('$netdev')[0] + self.parent.netdev + self.parent.netNonFormat.split('$netdev')[1]
else:
self.parent.netFormat = self.parent.netNonFormat
elif (sourceName == self.parent.tempdev):
value = str(round(float(data[QString(u'value')]), 1))
tempText = "%4s" % (value)
if (self.parent.tempFormat.split('$temp')[0] != self.parent.tempFormat):
line = self.parent.tempFormat.split('$temp')[0] + tempText + self.parent.tempFormat.split('$temp')[1]
else:
line = self.parent.tempFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_temp.setText(text)
elif (str(sourceName).split('/')[0] == "partitions"):
value = str(round(float(data[QString(u'value')]), 1))
hddText = "%5s" % (value)
text = self.parent.formatLine.split('$LINE')[0] + hddText + self.parent.formatLine.split('$LINE')[1]
exec ('self.parent.label_hdd_' + ''.join(str(sourceName).split('/')[1:-1]) + '.setText(text)')
elif (sourceName == "mem/physical/free"):
self.parent.mem_free = float(data[QString(u'value')])
elif (sourceName == "mem/physical/used"):
self.parent.mem_uf = float(data[QString(u'value')])
elif (sourceName == "mem/physical/application"):
if (self.parent.memInMb):
mem = str(round(float(data[QString(u'value')]) / 1024, 0)).split('.')[0]
mem = "%5s" % (mem)
if (self.parent.memFormat.split('$memmb')[0] != self.parent.memFormat):
line = self.parent.memFormat.split('$memmb')[0] + mem + self.parent.memFormat.split('$memmb')[1]
else:
line = self.parent.memFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_mem.setText(text)
else:
self.parent.mem_used = float(data[QString(u'value')])
elif (sourceName == "mem/swap/free"):
self.parent.swap_free = float(data[QString(u'value')])
elif (sourceName == "mem/swap/used"):
if (self.parent.swapInMb):
mem = str(round(float(data[QString(u'value')]) / 1024, 0)).split('.')[0]
mem = "%5s" % (mem)
if (self.parent.swapFormat.split('$swapmb')[0] != self.parent.swapFormat):
line = self.parent.swapFormat.split('$swapmb')[0] + mem + self.parent.swapFormat.split('$swapmb')[1]
else:
line = self.parent.swapFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_swap.setText(text)
else:
self.parent.swap_used = float(data[QString(u'value')])
elif (sourceName == "gpu"):
value = str(data[QString(u'GPU')])
gpuText = "%4s" % (value)
if (self.parent.gpuFormat.split('$gpu')[0] != self.parent.gpuFormat):
line = self.parent.gpuFormat.split('$gpu')[0] + gpuText + self.parent.gpuFormat.split('$gpu')[1]
else:
line = self.parent.gpuFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_gpu.setText(text)
elif (sourceName == "gputemp"):
value = str(data[QString(u'GPUTemp')])
gputempText = "%4s" % (value)
if (self.parent.gputempFormat.split('$gputemp')[0] != self.parent.gputempFormat):
line = self.parent.gputempFormat.split('$gputemp')[0] + gputempText + self.parent.gputempFormat.split('$gputemp')[1]
else:
line = self.parent.gputempFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_gputemp.setText(text)
elif (sourceName == "hddtemp"):
value = str(data[QString(self.parent.hddtempFormat.split('@@')[1])])
hddtempText = "%4s" % (value)
if (self.parent.hddtempFormat.split('@@')[0] != self.parent.hddtempFormat):
line = self.parent.hddtempFormat.split('@@')[0] + hddtempText + self.parent.hddtempFormat.split('@@')[2]
else:
line = self.parent.hddtempFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_hddtemp.setText(text)
elif (sourceName == "player"):
if (self.parent.player_name == 0):
album = str(data[QString(u'amarok_album')])
artist = str(data[QString(u'amarok_artist')])
progress = str(data[QString(u'amarok_progress')])
time = str(data[QString(u'amarok_duration')])
title = str(data[QString(u'amarok_title')])
elif (self.parent.player_name == 1):
album = str(data[QString(u'mpd_album')])
artist = str(data[QString(u'mpd_artist')])
progress = str(data[QString(u'mpd_progress')])
time = str(data[QString(u'mpd_duration')])
title = str(data[QString(u'mpd_title')])
elif (self.parent.player_name == 2):
album = str(data[QString(u'qmmp_album')])
artist = str(data[QString(u'qmmp_artist')])
progress = str(data[QString(u'qmmp_progress')])
time = str(data[QString(u'qmmp_duration')])
title = str(data[QString(u'qmmp_title')])
line = self.parent.playerFormat
if (line.split('$album')[0] != line):
line = line.split('$album')[0] + album + line.split('$album')[1]
if (line.split('$artist')[0] != line):
line = line.split('$artist')[0] + artist + line.split('$artist')[1]
if (line.split('$progress')[0] != line):
timeText = '%02i:%02i' % (int(time)/60, int(time)%60)
line = line.split('$progress')[0] + timeText + line.split('$progress')[1]
if (line.split('$time')[0] != line):
timeText = '%02i:%02i' % (int(time)/60, int(time)%60)
line = line.split('$time')[0] + timeText + line.split('$time')[1]
if (line.split('$title')[0] != line):
line = line.split('$title')[0] + title + line.split('$title')[1]
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_player.setText(text)
elif (sourceName == "Local"):
if (self.parent.timeFormat.split('$time')[0] != self.parent.timeFormat):
value = str(data[QString(u'DateTime')].toString(Qt.TextDate).toUtf8())
line = self.parent.timeFormat.split('$time')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$time')[1]
elif (self.parent.timeFormat.split('$isotime')[0] != self.parent.timeFormat):
value = str(data[QString(u'DateTime')].toString(Qt.ISODate).toUtf8())
line = self.parent.timeFormat.split('$isotime')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$isotime')[1]
elif (self.parent.timeFormat.split('$shorttime')[0] != self.parent.timeFormat):
value = str(data[QString(u'DateTime')].toString(Qt.SystemLocaleShortDate).toUtf8())
line = self.parent.timeFormat.split('$shorttime')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$shorttime')[1]
elif (self.parent.timeFormat.split('$longtime')[0] != self.parent.timeFormat):
value = str(data[QString(u'DateTime')].toString(Qt.SystemLocaleLongDate).toUtf8())
line = self.parent.timeFormat.split('$longtime')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$longtime')[1]
elif (self.parent.timeFormat.split('$snsntime')[0] != self.parent.timeFormat):
rawDate = str(data[QString(u'DateTime')].toString(Qt.TextDate).toUtf8())
value = rawDate.split()[0] + " " + rawDate.split()[2] + " " + \
rawDate.split()[1] + " " + ':'.join(rawDate.split()[3].split(':')[0:2])
line = self.parent.timeFormat.split('$snsntime')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$snsntime')[1]
elif (self.parent.timeFormat.split('$nsnstime')[0] != self.parent.timeFormat):
rawDate = str(data[QString(u'DateTime')].toString(Qt.TextDate).toUtf8())
value = ':'.join(rawDate.split()[3].split(':')[0:2]) + " " + rawDate.split()[0] + " " + \
rawDate.split()[2] + " " + rawDate.split()[1]
line = self.parent.timeFormat.split('$nsnstime')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$nsnstime')[1]
elif (self.parent.timeFormat.split('$custom')[0] != self.parent.timeFormat):
rawDate = data[QString(u'DateTime')]
line = ''.join(self.parent.timeFormat.split('$custom'))
for letters in timeLetters:
if (line.split('$'+letters)[0] != line):
line = line.split('$'+letters)[0] + \
str(data[QString(u'DateTime')].toString(letters).toUtf8()).decode("utf-8") + \
line.split('$'+letters)[1]
else:
line = self.parent.timeFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_time.setText(text)
self.parent.update()
#except:
#pass

View File

@ -0,0 +1,227 @@
# -*- coding: utf-8 -*-
# Copyright 2013 Evgeniy Alekseev <esalexeev@gmail.com>
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyKDE4.kdecore import *
from PyKDE4.kdeui import *
from PyKDE4.kio import *
from PyKDE4 import plasmascript
from PyKDE4.plasma import Plasma
import commands, os, shutil, time
import configdef
import configwindow
import dataengine
import reinit
from util import *
class pyTextWidget(plasmascript.Applet):
def __init__(self, parent, args=None):
"""widget definition"""
plasmascript.Applet.__init__(self, parent)
def init(self):
"""function to initializate widget"""
self._name = str(self.package().metadata().pluginName())
self.initTooltip()
self.layout = QGraphicsLinearLayout(Qt.Horizontal, self.applet)
self.dataengine = dataengine.DataEngine(self)
self.reinit = reinit.Reinit(self)
self.timer = QTimer()
QObject.connect(self.timer, SIGNAL("timeout()"), self.updateLabel)
self.setupVar()
self.reinit.reinit(confAccept=False)
self.setHasConfigurationInterface(True)
# Create notifyrc file if required
kdehome = unicode(KGlobal.dirs().localkdedir())
if ((not os.path.exists(kdehome + "/share/apps/plasma_applet_pytextmonitor/plasma_applet_pytextmonitor.notifyrc")) and
(not os.path.exists("/usr" + "/share/apps/plasma_applet_pytextmonitor/plasma_applet_pytextmonitor.notifyrc"))):
self.createNotifyrc(kdehome)
def createConfigurationInterface(self, parent):
"""function to setup configuration window"""
self.configpage = configwindow.ConfigWindow(self)
self.configdef = configdef.ConfigDefinition(self, self.configpage)
self.configdef.createConfigurationInterface(parent)
def createNotifyrc(self, kdehome):
"""function to create *.notifyrc"""
if (not os.path.isdir(kdehome + "/share/apps/plasma_applet_pytextmonitor")):
os.mkdir(kdehome + "/share/apps/plasma_applet_pytextmonitor")
shutil.copy(kdehome + "/share/apps/plasma/plasmoids/py-text-monitor/contents/code/plasma_applet_pytextmonitor.notifyrc",
kdehome + "/share/apps/plasma_applet_pytextmonitor/")
def initTooltip(self):
"""function to create tooltip"""
self.tooltip = Plasma.ToolTipContent()
self.tooltip.setMainText("PyTextMonitor")
self.tooltip.setSubText('')
Plasma.ToolTipManager.self().registerWidget(self.applet)
# show tooltip
#Plasma.ToolTipManager.self().setContent(self.applet, self.tooltip)
def mouseDoubleClickEvent(self, event):
"""function to doubleclick event"""
os.system("ksysguard &")
def setupNetdev(self):
"""function to setup network device"""
netdev = "lo"
try:
interfaces = []
for line in commands.getoutput("ifconfig -a -s").split("\n"):
if ((line.split()[0] != 'Iface') and (line.split()[0] != 'lo')):
interfaces.append(line.split()[0])
for device in interfaces:
if (commands.getoutput("ifconfig " + device + " | grep 'inet '") != ''):
netdev = device
break
except:
pass
return netdev
def setupVar(self):
"""function to setup variables"""
self.netdev = ''
# setup number of cores
commandOut = commands.getoutput("grep -c '^processor' /proc/cpuinfo")
self.numCores = int(commandOut)
self.tempdev = "tempdevice"
# create dictionaries
self.dict_orders = {'6':'bat', '1':'cpu', '7':'cpuclock', '9':'gpu', 'a':'gputemp',
'b':'hdd', 'c':'hddtemp', '3':'mem', '5':'net', '4':'swap', '2':'temp', '8':'uptime',
'd':'player', 'e':'time'}
self.dict_defFormat = {'bat':'[bat: $bat%$ac]', 'cpu':'[cpu: $cpu%]',
'cpuclock':'[mhz: $cpucl]', 'gpu':'[gpu: $gpu%]',
'gputemp':'[gpu temp: $gputemp&deg;C]', 'hdd':'[hdd: @@/@@%]',
'hddtemp':'[hdd temp: @@/dev/sda@@&deg;C]', 'mem':'[mem: $mem%]',
'net':'[$netdev: $netKB/s]', 'swap':'[swap: $swap%]',
'temp':'[temp: $temp&deg;C]', 'uptime':'[uptime: $uptime]',
'player':'[$artist - $title]', 'time':'[$time]'}
def showConfigurationInterface(self):
"""function to show configuration window"""
plasmascript.Applet.showConfigurationInterface(self)
def startPolling(self):
try:
self.timer.start()
self.updateLabel()
self.tooltip.setSubText('')
except Exception as strerror:
self.tooltip.setSubText(str(strerror))
self.label_error = Plasma.Label(self.applet)
self.label_error.setText('<font color="red">ERROR</font>')
self.layout.addItem(self.label_error)
return
def updateLabel(self):
"""function to update label"""
if ((self.memBool > 0) and (self.memInMb == False)):
self.memText()
if ((self.swapBool > 0) and (self.swapInMb == False)):
self.swapText()
if (self.batBool > 0):
self.batText()
def batText(self):
"""function to set battery text"""
line = self.batFormat
if (line.split('$bat')[0] != line):
try:
with open (self.battery_device, 'r') as bat_file:
bat = bat_file.readline().split('\n')[0]
except:
bat = 'off'
bat = "%3s" % (bat)
line = line.split('$bat')[0] + bat + line.split('$bat')[1]
if (line.split('$ac')[0] != line):
try:
with open (self.ac_device, 'r') as bat_file:
bat = bat_file.readline().split('\n')[0]
if (bat == '1'):
bat = '(*)'
else:
bat = '( )'
except:
bat = '(?)'
line = line.split('$ac')[0] + bat + line.split('$ac')[1]
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
self.label_bat.setText(text)
def memText(self):
"""function to set mem text"""
full = self.mem_uf + self.mem_free
try:
mem = 100 * self.mem_used / full
mem = "%5s" % (str(round(mem, 1)))
except:
mem = " N\\A"
if (self.memFormat.split('$mem')[0] != self.memFormat):
line = self.memFormat.split('$mem')[0] + mem + self.memFormat.split('$mem')[1]
else:
line = self.memFormat
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
self.label_mem.setText(text)
def swapText(self):
"""function to set swap text"""
full = self.swap_used + self.swap_free
try:
mem = 100 * self.swap_used / full
mem = "%5s" % (str(round(mem, 1)))
except:
mem = " N\\A"
if (self.swapFormat.split('$swap')[0] != self.swapFormat):
line = self.swapFormat.split('$swap')[0] + mem + self.swapFormat.split('$swap')[1]
else:
line = self.swapFormat
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
self.label_swap.setText(text)
@pyqtSignature("dataUpdated(const QString &, const Plasma::DataEngine::Data &)")
def dataUpdated(self, sourceName, data):
"""function to update label"""
self.dataengine.dataUpdated(sourceName, data)
def CreateApplet(parent):
return pyTextWidget(parent)

View File

@ -0,0 +1,266 @@
# -*- coding: utf-8 -*-
# Copyright 2013 Evgeniy Alekseev <esalexeev@gmail.com>
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from PyKDE4.kdecore import KComponentData
from PyKDE4.kdeui import KNotification
import commands
class PTMNotify:
def __init__(self, parent):
"""class definition"""
self.parent = parent
def init(self):
"""function to init notification"""
content = self.initText(self.parent)
self.createNotify(content)
def createNotify(self, content):
"""function to create notification for label"""
notification = KNotification(content[0])
notification.setComponentData(KComponentData("plasma_applet_pytextmonitor"))
notification.setTitle("PyTextMonitor info ::: " + content[0]);
notification.setText(content[1]);
notification.sendEvent();
def createText(self, type):
"""function to create text"""
text = ""
if (type == "system"):
try:
text = text + "Kernel: %s\n" %(commands.getoutput("uname -rsm"))
text = text + "Hostname: %s\n" %(commands.getoutput("uname -n"))
text = text + "Whoami: %s\n" %(commands.getoutput("whoami"))
text = text + "Uptime: %s\n" %(commands.getoutput("uptime"))
except:
text = "Something wrong"
elif (type == "processor"):
try:
output = commands.getoutput("grep 'model name' /proc/cpuinfo | head -1")
text = text + "Model: %s\n" %(' '.join(output.split()[3:]))
output = commands.getoutput("sar -u | tail -1")
text = text + "CPU Usage: %s%%\n" %(str(100-float(output.split()[-1])))
output = commands.getoutput("grep MHz /proc/cpuinfo | head -1")
text = text + "CPU Freq: %s MHz\n" %(str(int(float(output.split()[-1]))))
output = commands.getoutput("sensors -u")
text = text + "Temps:"
for line in output.split("\n"):
if (line.find("_input") > -1):
text = text + " %s\xb0C" %(str(round(float(line.split()[-1]), 0)))
except:
text = "Something wrong"
elif (type == "graphical"):
try:
output = commands.getoutput("lspci -m | grep 'VGA\|3D'")
if (output.lower().find('nvidia') > -1):
gpudev = "nvidia"
elif (output.lower().find('radeon') > -1):
gpudev = "ati"
for line in output.split("\n"):
text = text + "%s %s\n" %(line.split('"')[0], line.split('"')[5])
if (gpudev == 'nvidia'):
output = commands.getoutput("nvidia-smi -q -d UTILIZATION | grep Gpu | tail -n1")
try:
value = "%5s" % (str(round(float(output.split()[2][:-1]), 1)))
except:
value = " N\A"
elif (gpudev == 'ati'):
output = commands.getoutput("aticonfig --od-getclocks | grep load | tail -n1")
try:
value = "%5s" % (str(round(float(output.split()[3][:-1]), 1)))
except:
value = " N\A"
else:
value = " N\A"
text = text + "Load: %s%%\n" %(value)
if (gpudev == 'nvidia'):
output = commands.getoutput("nvidia-smi -q -d TEMPERATURE | grep Gpu | tail -n1")
try:
value = "%5s" % (str(round(float(output.split()[2][:-1]), 1)))
except:
value = " N\A"
elif (gpudev == 'ati'):
output = commands.getoutput("aticonfig --od-gettemperature | grep Temperature | tail -n1")
try:
value = "%5s" % (str(round(float(output.split()[3][:-1]), 1)))
except:
value = " N\A"
else:
value = " N\A"
text = text + "Temp: %s\xb0C\n" %(value)
except:
text = "Something wrong"
elif (type == "memory"):
try:
output = commands.getoutput("free -m -o").split("\n")
memusage = int(output[1].split()[1]) - (int(output[1].split()[3]) + int(output[1].split()[5]) + int(output[1].split()[6]))
text = text + "Memory: %s of %s (%s%%)\n" %(str(memusage), output[1].split()[1], str(int(100*memusage/int(output[1].split()[1]))))
text = text + "Swap: %s of %s (%s%%)\n" %(output[2].split()[2], output[2].split()[1], str(int(100*int(output[2].split()[2])/int(output[2].split()[1]))))
output = commands.getoutput("swapon --show").split("\n")
text = text + "Swap Device: %s (%s)" %(output[1].split()[0], output[1].split()[1])
except:
text = "Something wrong"
elif (type == "disk"):
try:
output = commands.getoutput("df -h --output='source,target,used,size,pcent' --exclude-type=fuseblk --exclude-type=tmpfs --exclude-type=devtmpfs").split("\n")[1:]
for line in output:
text = text + "%s (to %s): %s of %s (%s)\n" %(line.split()[0], line.split()[1], line.split()[2], line.split()[3], line.split()[4])
except:
text = "Something wrong"
elif (type == "network"):
try:
output = commands.getoutput("ifconfig -a -s").split("\n")[1:]
text = text + "Devices:"
for line in output:
text = text + " %s" %(line.split()[0])
output = commands.getoutput("ifconfig -a -s " + self.parent.parent.netdev + " && sleep 0.2 && ifconfig -a -s " + self.parent.parent.netdev).split("\n")
download = int((int(output[3].split()[2]) - int(output[1].split()[2])) / (0.2 * 1024))
upload = int((int(output[3].split()[6]) - int(output[1].split()[6])) / (0.2 * 1024))
text = text + "\n%s: %s/%s KB/s\n" %(self.parent.parent.netdev, download, upload)
output = commands.getoutput("ifconfig " + self.parent.parent.netdev + " | grep 'inet '").split()[1]
text = text + "IP: %s\n" %(output[:-1])
output = commands.getoutput("wget http://checkip.dyndns.org/ -q -O - | awk '{print $6}' | sed 's/<.*>//g'")
text = text + "External IP: %s" %(output[:-1])
except:
text = "Something wrong"
elif (type == "battery"):
try:
text = text + "%s" %(commands.getoutput("acpi -abi"))
except:
text = "Something wrong"
elif (type == "musicplayer"):
try:
artist = "N\\A"
album = "N\\A"
title = "N\\A"
if (self.parent.parent.player_name == 0):
artist = commands.getoutput("qdbus org.kde.amarok /Player GetMetadata 2> /dev/null | grep albumartist: | cut -c14-")
album = commands.getoutput("qdbus org.kde.amarok /Player GetMetadata 2> /dev/null | grep album: | cut -c8-")
title = commands.getoutput("qdbus org.kde.amarok /Player GetMetadata 2> /dev/null | grep title: | cut -c8-")
elif (self.parent.parent.player_name == 1):
output = commands.getoutput("echo 'currentsong\nclose' | curl --connect-timeout 1 -fsm 3 telnet://localhost:6600 2> /dev/null")
for line in output.split("\n"):
if (line.split(": ")[0] == "Artist"):
artist = line.split(": ")[1]
elif (line.split(": ")[0] == "Album"):
album = line.split(": ")[1]
elif (line.split(": ")[0] == "Title"):
title = line.split(": ")[1]
elif (self.parent.parent.player_name == 2):
artist = commands.getoutput("qmmp --nowplaying '%if(%p,%p,Unknown)' 2> /dev/null")
album = commands.getoutput("qmmp --nowplaying '%if(%a,%a,Unknown)' 2> /dev/null")
title = commands.getoutput("qmmp --nowplaying '%if(%t,%t,Unknown)' 2> /dev/null")
text = text + "Artist: %s\nAlbum: %s\nTitle: %s" %(artist, album, title)
except:
text = "Something wrong"
content = [type, text]
return content
def initText(self, sender):
"""function to send text"""
try:
if (sender == self.parent.parent.label_time):
content = self.createText("system")
return content
except:
pass
try:
if (sender == self.parent.parent.label_uptime):
content = self.createText("system")
return content
except:
pass
try:
if (sender == self.parent.parent.label_cpu):
content = self.createText("processor")
return content
except:
pass
try:
if (sender == self.parent.parent.label_cpuclock):
content = self.createText("processor")
return content
except:
pass
try:
if (sender == self.parent.parent.label_temp):
content = self.createText("processor")
return content
except:
pass
try:
if (sender == self.parent.parent.label_gpu):
content = self.createText("graphical")
return content
except:
pass
try:
if (sender == self.parent.parent.label_gputemp):
content = self.createText("graphical")
return content
except:
pass
try:
if (sender == self.parent.parent.label_mem):
content = self.createText("memory")
return content
except:
pass
try:
if (sender == self.parent.parent.label_swap):
content = self.createText("memory")
return content
except:
pass
try:
if (sender == self.parent.parent.label_hdd0):
content = self.createText("disk")
return content
except:
pass
try:
if (sender == self.parent.parent.label_hddtemp):
content = self.createText("disk")
return content
except:
pass
try:
if (sender == self.parent.parent.label_netDown):
content = self.createText("network")
return content
except:
pass
try:
if (sender == self.parent.parent.label_bat):
content = self.createText("battery")
return content
except:
pass
try:
if (sender == self.parent.parent.label_player):
content = self.createText("musicplayer")
return content
except:
pass

View File

@ -0,0 +1,339 @@
# -*- coding: utf-8 -*-
# Copyright 2013 Evgeniy Alekseev <esalexeev@gmail.com>
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyKDE4.plasma import Plasma
import config
import ptmnotify
class NewPlasmaLabel(Plasma.Label):
"""new Label with defined clicked() event"""
def __init__(self, applet, parent):
"""class definition"""
Plasma.Label.__init__(self, applet)
self.parent = parent
self.notify = ptmnotify.PTMNotify(self)
def mousePressEvent(self, event):
"""mouse click event"""
if (event.button() == Qt.LeftButton):
self.notify.init()
class Reinit():
def __init__(self, parent):
"""class definition"""
self.parent = parent
def reinit(self, confAccept=False):
"""function to reinitializate widget"""
settings = config.Config(self.parent)
self.parent.interval = settings.get('interval', 2000).toInt()[0]
self.parent.font_family = str(settings.get('font_family', 'Terminus'))
self.parent.font_size = settings.get('font_size', 12).toInt()[0]
self.parent.font_color = str(settings.get('font_color', '#000000'))
self.parent.font_style = str(settings.get('font_style', 'normal'))
self.parent.font_weight = settings.get('font_weight', 400).toInt()[0]
self.parent.formatLine = "<pre><p align=\"center\"><span style=\" font-family:'" + self.parent.font_family + "'; font-style:" + self.parent.font_style
self.parent.formatLine = self.parent.formatLine + "; font-size:" + str(self.parent.font_size) + "pt; font-weight:" + str(self.parent.font_weight)
self.parent.formatLine = self.parent.formatLine + "; color:" + self.parent.font_color + ";\">$LINE</span></p></pre>"
self.parent.label_order = str(settings.get('label_order', '1345'))
for label in self.parent.dict_orders.values():
if ((label == 'cpu') or (label == 'mem') or (label == 'swap') or (label == 'net')):
exec ('self.parent.' + label + 'Bool = int(settings.get("' + label + 'Bool", 2))')
else:
exec ('self.parent.' + label + 'Bool = int(settings.get("' + label + 'Bool", 0))')
# labels
for order in self.parent.label_order:
if (order == "1"):
if (self.parent.cpuBool > 0):
self.parent.cpuFormat = str(settings.get('cpuFormat', '[cpu: $cpu%]'))
if (self.parent.cpuFormat.split('$ccpu')[0] != self.parent.cpuFormat):
self.parent.label_cpu = NewPlasmaLabel(self.parent.applet, self.parent)
self.parent.label_cpu1 = Plasma.Label(self.parent.applet)
if (self.parent.cpuFormat.split('$ccpu')[0].split('$cpu')[0] != self.parent.cpuFormat.split('$ccpu')[0]):
line = self.parent.cpuFormat.split('$ccpu')[0].split('$cpu')[0] + '-----' + self.parent.cpuFormat.split('$ccpu')[0].split('$cpu')[1]
else:
line = self.parent.cpuFormat.split('$ccpu')[0]
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_cpu.setText(text)
self.parent.layout.addItem(self.parent.label_cpu)
text = self.parent.formatLine.split('$LINE')[0] + "-----" + self.parent.formatLine.split('$LINE')[1]
for core in range(self.parent.numCores):
exec ('self.parent.label_coreCpu' + str(core) + ' = Plasma.Label(self.parent.applet)')
exec ('self.parent.label_coreCpu' + str(core) + '.setText(text)')
exec ('self.parent.layout.addItem(self.parent.label_coreCpu' + str(core) + ')')
if (self.parent.cpuFormat.split('$ccpu')[1].split('$cpu')[0] != self.parent.cpuFormat.split('$ccpu')[1]):
line = self.parent.cpuFormat.split('$ccpu')[1].split('$cpu')[0] + '-----' + self.parent.cpuFormat.split('$ccpu')[1].split('$cpu')[1]
else:
line = self.parent.cpuFormat.split('$ccpu')[1]
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_cpu1.setText(text)
self.parent.layout.addItem(self.parent.label_cpu1)
else:
self.parent.label_cpu = NewPlasmaLabel(self.parent.applet, self.parent)
if (self.parent.cpuFormat.split('$cpu')[0] != self.parent.cpuFormat):
line = self.parent.cpuFormat.split('$cpu')[0] + '-----' + self.parent.cpuFormat.split('$cpu')[1]
else:
line = self.parent.cpuFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_cpu.setText(text)
self.parent.layout.addItem(self.parent.label_cpu)
elif (order == "2"):
if (self.parent.tempBool > 0):
self.parent.tempdev = str(settings.get('temp_device', '<select device>'))
self.parent.tempFormat = str(settings.get('tempFormat', '[temp: $temp&deg;C]'))
self.parent.label_temp = NewPlasmaLabel(self.parent.applet, self.parent)
if (self.parent.tempFormat.split('$temp')[0] != self.parent.tempFormat):
line = self.parent.tempFormat.split('$temp')[0] + '----' + self.parent.tempFormat.split('$temp')[1]
else:
line = self.parent.tempFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_temp.setText(text)
self.parent.layout.addItem(self.parent.label_temp)
elif (order == "3"):
if (self.parent.memBool > 0):
self.parent.memFormat = str(settings.get('memFormat', '[mem: $mem%]'))
if (self.parent.memFormat.split('$memmb')[0] != self.parent.memFormat):
self.parent.memInMb = True
line = self.parent.memFormat.split('$memmb')[0] + '-----' + self.parent.memFormat.split('$memmb')[1]
elif (self.parent.memFormat.split('$mem')[0] != self.parent.memFormat):
self.parent.memInMb = False
self.parent.mem_used = 0.0
self.parent.mem_free = 1.0
self.parent.mem_uf = 0.0
line = self.parent.memFormat.split('$mem')[0] + '-----' + self.parent.memFormat.split('$mem')[1]
else:
line = self.parent.memFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_mem = NewPlasmaLabel(self.parent.applet, self.parent)
self.parent.label_mem.setText(text)
self.parent.layout.addItem(self.parent.label_mem)
elif (order == "4"):
if (self.parent.swapBool > 0):
self.parent.swapFormat = str(settings.get('swapFormat', '[swap: $swap%]'))
if (self.parent.swapFormat.split('$swapmb')[0] != self.parent.swapFormat):
self.parent.swapInMb = True
line = self.parent.swapFormat.split('$swapmb')[0] + '-----' + self.parent.swapFormat.split('$swapmb')[1]
elif (self.parent.swapFormat.split('$swap')[0] != self.parent.swapFormat):
self.parent.swapInMb = False
self.parent.swap_free = 1.0
self.parent.swap_used = 0.0
line = self.parent.swapFormat.split('$swap')[0] + '-----' + self.parent.swapFormat.split('$swap')[1]
else:
line = self.parent.swapFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_swap = NewPlasmaLabel(self.parent.applet, self.parent)
self.parent.label_swap.setText(text)
self.parent.layout.addItem(self.parent.label_swap)
elif (order == "5"):
if (self.parent.netBool > 0):
self.parent.netNonFormat = str(settings.get('netNonFormat', '[net: $netKB/s]'))
if (self.parent.netNonFormat.split('@@')[0] != self.parent.netNonFormat):
self.parent.netdev = self.parent.netNonFormat.split('@@')[1]
self.parent.netNonFormat = self.parent.netNonFormat.split('@@')[0] + self.parent.netNonFormat.split('@@')[2]
else:
self.parent.netdev = self.parent.setupNetdev()
if (self.parent.netNonFormat.split('$netdev')[0] != self.parent.netNonFormat):
self.parent.netFormat = self.parent.netNonFormat.split('$netdev')[0] + self.parent.netdev + self.parent.netNonFormat.split('$netdev')[1]
else:
self.parent.netFormat = self.parent.netNonFormat
self.parent.label_netDown = NewPlasmaLabel(self.parent.applet, self.parent)
if (self.parent.netFormat.split('$net')[0] != self.parent.netFormat):
line = self.parent.netFormat.split('$net')[0] + '----'
else:
line = self.parent.netFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_netDown.setText(text)
self.parent.layout.addItem(self.parent.label_netDown)
self.parent.label_netUp = Plasma.Label(self.parent.applet)
if (self.parent.netFormat.split('$net')[0] != self.parent.netFormat):
line = '/----' + self.parent.netFormat.split('$net')[1]
else:
line = ''
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_netUp.setText(text)
self.parent.layout.addItem(self.parent.label_netUp)
elif (order == "6"):
if (self.parent.batBool > 0):
self.parent.batFormat = str(settings.get('batFormat', '[bat: $bat%$ac]'))
self.parent.battery_device= str(settings.get('battery_device', '/sys/class/power_supply/BAT0/capacity'))
self.parent.ac_device = str(settings.get('ac_device', '/sys/class/power_supply/AC/online'))
self.parent.label_bat = NewPlasmaLabel(self.parent.applet, self.parent)
line = self.parent.batFormat
if (line.split('$ac')[0] != line):
line = line.split('$ac')[0] + '(-)' + line.split('$ac')[1]
if (line.split('$bat')[0] != line):
line = line.split('$bat')[0] + '---' + line.split('$bat')[1]
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_bat.setText(text)
self.parent.layout.addItem(self.parent.label_bat)
elif (order == "7"):
if (self.parent.cpuclockBool > 0):
self.parent.cpuclockFormat = str(settings.get('cpuclockFormat', '[mhz: $cpucl]'))
if (self.parent.cpuclockFormat.split('$ccpucl')[0] != self.parent.cpuclockFormat):
self.parent.label_cpuclock = NewPlasmaLabel(self.parent.applet, self.parent)
self.parent.label_cpuclock1 = Plasma.Label(self.parent.applet)
if (self.parent.cpuclockFormat.split('$ccpucl')[0].split('$cpucl')[0] != self.parent.cpuclockFormat.split('$ccpucl')[0]):
line = self.parent.cpuclockFormat.split('$ccpucl')[0].split('$cpucl')[0] + '----' + self.parent.cpuclockFormat.split('$ccpucl')[0].split('$cpucl')[1]
else:
line = self.parent.cpuclockFormat.split('$ccpucl')[0]
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_cpuclock.setText(text)
self.parent.layout.addItem(self.parent.label_cpuclock)
text = self.parent.formatLine.split('$LINE')[0] + "----" + self.parent.formatLine.split('$LINE')[1]
for core in range(self.parent.numCores):
exec ('self.parent.label_coreCpuclock' + str(core) + ' = Plasma.Label(self.parent.applet)')
exec ('self.parent.label_coreCpuclock' + str(core) + '.setText(text)')
exec ('self.parent.layout.addItem(self.parent.label_coreCpuclock' + str(core) + ')')
if (self.parent.cpuclockFormat.split('$ccpucl')[1].split('$cpucl')[0] != self.parent.cpuclockFormat.split('$ccpucl')[1]):
line = self.parent.cpuclockFormat.split('$ccpucl')[1].split('$cpucl')[0] + '----' + self.parent.cpuclockFormat.split('$ccpucl')[1].split('$cpucl')[1]
else:
line = self.parent.cpuclockFormat.split('$ccpucl')[1]
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_cpuclock1.setText(text)
self.parent.layout.addItem(self.parent.label_cpuclock1)
else:
self.parent.label_cpuclock = NewPlasmaLabel(self.parent.applet, self.parent)
if (self.parent.cpuclockFormat.split('$cpucl')[0] != self.parent.cpuclockFormat):
line = self.parent.cpuclockFormat.split('$cpucl')[0] + '----' + self.parent.cpuclockFormat.split('$cpucl')[1]
else:
line = self.parent.cpuclockFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_cpuclock.setText(text)
self.parent.layout.addItem(self.parent.label_cpuclock)
elif (order == "8"):
if (self.parent.uptimeBool > 0):
self.parent.uptimeFormat = str(settings.get('uptimeFormat', '[uptime: $uptime]'))
self.parent.label_uptime = NewPlasmaLabel(self.parent.applet, self.parent)
if (self.parent.uptimeFormat.split('$uptime')[0] != self.parent.uptimeFormat):
line = self.parent.uptimeFormat.split('$uptime')[0] + '---d--h--m' + self.parent.uptimeFormat.split('$uptime')[1]
else:
line = self.parent.uptimeFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_uptime.setText(text)
self.parent.layout.addItem(self.parent.label_uptime)
elif (order == "9"):
if (self.parent.gpuBool > 0):
self.parent.gpuFormat = str(settings.get('gpuFormat', '[gpu: $gpu%]'))
self.parent.label_gpu = NewPlasmaLabel(self.parent.applet, self.parent)
if (self.parent.gpuFormat.split('$gpu')[0] != self.parent.gpuFormat):
line = self.parent.gpuFormat.split('$gpu')[0] + '-----' + self.parent.gpuFormat.split('$gpu')[1]
else:
line = self.parent.gpuFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_gpu.setText(text)
self.parent.layout.addItem(self.parent.label_gpu)
elif (order == "a"):
if (self.parent.gputempBool > 0):
self.parent.gputempFormat = str(settings.get('gputempFormat', '[gpu temp: $gputemp&deg;C]'))
self.parent.label_gputemp = NewPlasmaLabel(self.parent.applet, self.parent)
if (self.parent.gputempFormat.split('$gputemp')[0] != self.parent.gputempFormat):
line = self.parent.gputempFormat.split('$gputemp')[0] + '----' + self.parent.gputempFormat.split('$gputemp')[1]
else:
line = self.parent.gputempFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_gputemp.setText(text)
self.parent.layout.addItem(self.parent.label_gputemp)
elif (order == "b"):
if (self.parent.hddBool > 0):
self.parent.hddFormat = str(settings.get('hddFormat', '[hdd: @@/@@%]'))
if (self.parent.hddFormat.split('@@')[0] != self.parent.hddFormat):
self.parent.mountPoints = self.parent.hddFormat.split('@@')[1].split(';')
line = self.parent.hddFormat.split('@@')[0]
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_hdd0 = NewPlasmaLabel(self.parent.applet, self.parent)
self.parent.label_hdd0.setText(text)
self.parent.layout.addItem(self.parent.label_hdd0)
text = self.parent.formatLine.split('$LINE')[0] + "-----" + self.parent.formatLine.split('$LINE')[1]
for mount in self.parent.mountPoints:
exec ('self.parent.label_hdd_' + ''.join(mount.split('/')) + ' = Plasma.Label(self.parent.applet)')
exec ('self.parent.label_hdd_' + ''.join(mount.split('/')) + '.setText(text)')
exec ('self.parent.layout.addItem(self.parent.label_hdd_' + ''.join(mount.split('/')) + ')')
line = self.parent.hddFormat.split('@@')[2]
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_hdd1 = Plasma.Label(self.parent.applet)
self.parent.label_hdd1.setText(text)
self.parent.layout.addItem(self.parent.label_hdd1)
else:
line = self.parent.hddFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_hdd0.setText(text)
self.parent.layout.addItem(self.parent.label_hdd0)
elif (order == "c"):
if (self.parent.hddtempBool > 0):
self.parent.hddtempFormat = str(settings.get('hddtempFormat', '[hdd temp: @@/dev/sda@@&deg;C]'))
self.parent.label_hddtemp = NewPlasmaLabel(self.parent.applet, self.parent)
if (self.parent.hddtempFormat.split('@@')[0] != self.parent.hddtempFormat):
line = self.parent.hddtempFormat.split('@@')[0] + '----' + self.parent.hddtempFormat.split('@@')[2]
else:
line = self.parent.hddtempFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_hddtemp.setText(text)
self.parent.layout.addItem(self.parent.label_hddtemp)
elif (order == "d"):
if (self.parent.playerBool > 0):
self.parent.playerFormat = str(settings.get('playerFormat', '[$artist - $title]'))
self.parent.player_name = settings.get('player_name', 0).toInt()[0]
self.parent.label_player = NewPlasmaLabel(self.parent.applet, self.parent)
line = self.parent.playerFormat
if (line.split('$album')[0] != line):
line = line.split('$album')[0] + 'N\\A' + line.split('$album')[1]
if (line.split('$artist')[0] != line):
line = line.split('$artist')[0] + 'N\\A' + line.split('$artist')[1]
if (line.split('$progress')[0] != line):
line = line.split('$progress')[0] + '00:00' + line.split('$progress')[1]
if (line.split('$title') != line):
line = line.split('$title')[0] + 'N\\A' + line.split('$title')[1]
if (line.split('$time') != line):
line = line.split('$time')[0] + '00:00' + line.split('$time')[1]
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_player.setText(text)
self.parent.layout.addItem(self.parent.label_player)
elif (order == "e"):
if (self.parent.timeBool > 0):
self.parent.timeFormat = str(settings.get('timeFormat', '[$time]'))
self.parent.label_time = NewPlasmaLabel(self.parent.applet, self.parent)
if (self.parent.timeFormat.split('$time')[0] != self.parent.timeFormat):
line = self.parent.timeFormat.split('$time')[0] + '----------------------' + self.parent.timeFormat.split('$time')[1]
else:
line = self.parent.timeFormat
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
self.parent.label_time.setText(text)
self.parent.layout.addItem(self.parent.label_time)
if not confAccept:
self.parent.layout.setContentsMargins(0, 0, 0, 0)
self.parent.applet.setLayout(self.parent.layout)
self.parent.theme = Plasma.Svg(self.parent)
self.parent.theme.setImagePath("widgets/background")
self.parent.setBackgroundHints(Plasma.Applet.DefaultBackground)
self.parent.resize(10, 10)
# create dataengines
self.parent.thread().wait(60000)
self.parent.dataengine.connectToEngine()
self.parent.timer.setInterval(self.parent.interval)
self.parent.startPolling()

View File

@ -0,0 +1,56 @@
# -*- coding: utf-8 -*-
# Copyright 2012 Alex Oleshkevich <alex.oleshkevich@gmail.com>
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from shutil import copyfile
from PyKDE4.kdecore import *
import os
class Util():
def __init__(self, applet):
self.applet = applet
def createDirectory(self, name):
if not os.path.isdir(name):
try:
os.mkdir(name)
except:
print 'Failed to create directory: ' + name
def kdeHome(self):
return unicode(KGlobal.dirs().localkdedir())
def createNotifyrc(self):
print '[%s] creating notifyrc' % (self.applet._name)
self.createDirectory(self.kdeHome() + 'share/apps/%s' % self.applet._name)
source = self.applet.package().path() + 'contents/misc/%s.notifyrc' % self.applet._name
destination = self.kdeHome() + 'share/apps/%s/%s.notifyrc' % (self.applet._name, self.applet._name)
copyfile(source, destination)
def createConfig(self):
self.createDirectory(self.kdeHome() + 'share/apps/%s' % self.applet._name)
source = self.applet.package().path() + 'contents/misc/%s.ini' % self.applet._name
destination = self.kdeHome() + 'share/apps/%s/%s.ini' % (self.applet._name, self.applet._name)
copyfile(source, destination)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
[Desktop Entry]
Encoding=UTF-8
Name=Py Text Monitor
ServiceTypes=Plasma/Applet
Type=Service
Icon=utilities-system-monitor
X-Plasma-API=python
X-Plasma-MainScript=code/main.py
X-Plasma-RequiredExtensions=LaunchApp,LocalIO,FileDialog
X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis
X-KDE-PluginInfo-Email=esalexeev@gmail.com
X-KDE-PluginInfo-Name=py-text-monitor
X-KDE-PluginInfo-Version=@PROJECT_VERSION@
X-KDE-PluginInfo-Website=http://kde-look.org/
X-KDE-PluginInfo-Category=System Information
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true

View File

@ -0,0 +1,49 @@
[Global]
IconName=system
Name=PyTextMonitor
Comment=PyTextMonitor information
[Event/system]
Name=System information
Comment=System information
Action=Popup
[Event/processor]
Name=Processor information
Comment=Processor information
Action=Popup
[Event/graphical]
Name=GPU information
Comment=GPU information
Action=Popup
[Event/memory]
Name=Memory information
Comment=Memory information
Action=Popup
[Event/disk]
Name=Disk information
Comment=Disk information
Action=Popup
[Event/network]
Name=Network information
Comment=Network information
Action=Popup
[Event/battery]
Name=Battery information
Comment=Battery information
Action=Popup
[Event/graphinfo]
Name=Graphical Information
Comment=Graphical Information
Action=Popup
[Event/musicplayer]
Name=Now playing
Comment=Now playing
Action=Popup

View File

@ -0,0 +1,24 @@
find_package(KDE4 REQUIRED)
find_package(Gettext REQUIRED)
if (NOT GETTEXT_MSGFMT_EXECUTABLE)
message(FATAL_ERROR "Please install the msgfmt binary")
endif (NOT GETTEXT_MSGFMT_EXECUTABLE)
file (GLOB _po_files *.po)
set (_gmoFiles)
foreach (_current_PO_FILE ${_po_files})
get_filename_component (_lang ${_current_PO_FILE} NAME_WE)
set (_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
add_custom_command (OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
DEPENDS ${_current_PO_FILE}
)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo DESTINATION ${LOCALE_INSTALL_DIR}/${_lang}/LC_MESSAGES/ RENAME py-text-monitor.mo)
list (APPEND _gmoFiles ${_gmoFile})
endforeach (_current_PO_FILE)
add_custom_target (pofiles ALL DEPENDS ${_gmoFiles})

View File

@ -0,0 +1,15 @@
#!/bin/sh
WDIR=`pwd` # working dir
SATELLITE_LIST=satellite.list
BACKGROUND_LIST=background.list
# Background list
cd "$WDIR"
cd ../images
ls -1 background_* | sed -e "s/background_//g" | sed -e "s/_/ /g" | sed -e "s/\.jpg//g" | sed -e "s/\.png//g" | sed -e "s/\.gif//g" | grep -v '^$' | sort --unique --ignore-leading-blanks > "$WDIR/background.list"
# Satellite list
cd "$WDIR"
cd ../data
cat satellite_images.xml | grep image\ name | sed -e "s/.*<image name=\"\([^\"]*\).*/\1/" | sed -e "s/\&amp;/\&/g" | sed -e "s/\&apos;/'/g" | sed -e "s/\&quot;/\"/g" | sed -e "s/\&lt;/</g" | sed -e "s/\&gt;/>/g" | grep -v '^$' | sort --unique --ignore-leading-blanks > "$WDIR/satellite.list"

364
sources/ptm/po/en.po Normal file
View File

@ -0,0 +1,364 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Evgeniy Alekseev <esalexeev@gmail.com>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: http://kde-look.org/content/show.php?content=157124\n"
"POT-Creation-Date: 2014-03-30 13:27+0400\n"
"PO-Revision-Date: 2014-03-30 13:28+0400\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: Russian <kde-russian@lists.kde.ru>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<"
"=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 1.5\n"
#. i18n: file: ui/configwindow.ui:32
#. i18n: ectx: property (windowTitle), widget (QWidget, ConfigWindow)
#: rc.cpp:3
msgid "Form"
msgstr "Form"
#. i18n: file: ui/configwindow.ui:42
#. i18n: ectx: attribute (title), widget (QWidget, settings)
#: rc.cpp:6
msgid "Widget settings"
msgstr "Widget settings"
#. i18n: file: ui/configwindow.ui:56
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_time)
#: rc.cpp:9
msgid "Time"
msgstr "Time"
#. i18n: file: ui/configwindow.ui:75
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_time)
#: rc.cpp:12
msgid ""
"$time - time in default format\n"
"$isotime - time in ISO format\n"
"$shorttime - time in short format\n"
"$longtime - time in log format\n"
"$custom: $dddd - long weekday; $ddd - short weekday; $dd - day; $d day w\\o "
"zero; \n"
"\t$MMMM - long month; $MMM - short month; $MM - month; $M - month w\\o "
"zero; \n"
"\t$yyyy - year; $yy short year; \n"
"\t$hh - hours (24 only); $h - hours w\\o zero (24 only); \n"
"\t$mm - minutes; $m - minutes w\\o zero;\n"
"\t$ss - seconds; $s - seconds w\\o zero"
msgstr ""
"$time - time in default format\n"
"$isotime - time in ISO format\n"
"$shorttime - time in short format\n"
"$longtime - time in log format\n"
"$custom: $dddd - long weekday; $ddd - short weekday; $dd - day; $d day w\\o "
"zero; \n"
"\t$MMMM - long month; $MMM - short month; $MM - month; $M - month w\\o "
"zero; \n"
"\t$yyyy - year; $yy short year; \n"
"\t$hh - hours (24 only); $h - hours w\\o zero (24 only); \n"
"\t$mm - minutes; $m - minutes w\\o zero;\n"
"\t$ss - seconds; $s - seconds w\\o zero"
#. i18n: file: ui/configwindow.ui:120
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_uptime)
#: rc.cpp:24
msgid "Uptime"
msgstr "Uptime"
#. i18n: file: ui/configwindow.ui:131
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_uptime)
#: rc.cpp:27
msgid ""
"$uptime - system uptime\n"
"$custom: $ds - uptime days; $hs - uptime hours; $ms - uptime minutes"
msgstr ""
"$uptime - system uptime\n"
"$custom: $ds - uptime days; $hs - uptime hours; $ms - uptime minutes"
#. i18n: file: ui/configwindow.ui:179
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_cpu)
#: rc.cpp:31
msgid "CPU"
msgstr "CPU"
#. i18n: file: ui/configwindow.ui:190
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_cpu)
#: rc.cpp:35
#, no-c-format
msgid ""
"$cpu - total load CPU, %\n"
"$ccpu - load CPU for each core, %"
msgstr ""
"$cpu - total load CPU, %\n"
"$ccpu - load CPU for each core, %"
#. i18n: file: ui/configwindow.ui:238
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_cpuclock)
#: rc.cpp:39
msgid "CPU Clock"
msgstr "CPU Clock"
#. i18n: file: ui/configwindow.ui:249
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_cpuclock)
#: rc.cpp:42
msgid ""
"$cpucl - average CPU clock, MHz\n"
"$ccpucl - CPU clock for each core, MHz"
msgstr ""
"$cpucl - average CPU clock, MHz\n"
"$ccpucl - CPU clock for each core, MHz"
#. i18n: file: ui/configwindow.ui:297
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_temp)
#: rc.cpp:46
msgid "Temperature"
msgstr "Temperature"
#. i18n: file: ui/configwindow.ui:320
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_temp)
#: rc.cpp:49
msgid "$temp - physical temperature on CPU"
msgstr "$temp - physical temperature on CPU"
#. i18n: file: ui/configwindow.ui:368
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_gpu)
#: rc.cpp:52
msgid "GPU"
msgstr "GPU"
#. i18n: file: ui/configwindow.ui:378
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_gpu)
#: rc.cpp:56
#, no-c-format
msgid "$gpu - gpu usage, %"
msgstr "$gpu - gpu usage, %"
#. i18n: file: ui/configwindow.ui:426
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_gpuTemp)
#: rc.cpp:59
msgid "GPU Temp"
msgstr "GPU Temp"
#. i18n: file: ui/configwindow.ui:436
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_gpuTemp)
#: rc.cpp:62
msgid "$gputemp - physical temperature on GPU"
msgstr "$gputemp - physical temperature on GPU"
#. i18n: file: ui/configwindow.ui:484
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_mem)
#: rc.cpp:65
msgid "Memory"
msgstr "Memory"
#. i18n: file: ui/configwindow.ui:495
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_mem)
#: rc.cpp:69
#, no-c-format
msgid ""
"$mem - RAM usage, %\n"
"$memmb - RAM usage, MB"
msgstr ""
"$mem - RAM usage, %\n"
"$memmb - RAM usage, MB"
#. i18n: file: ui/configwindow.ui:543
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_swap)
#: rc.cpp:73
msgid "Swap"
msgstr "Swap"
#. i18n: file: ui/configwindow.ui:554
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_swap)
#: rc.cpp:77
#, no-c-format
msgid ""
"$swap - swap usage, %\n"
"$swapmb - swap usage, MB"
msgstr ""
"$swap - swap usage, %\n"
"$swapmb - swap usage, MB"
#. i18n: file: ui/configwindow.ui:602
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_hdd)
#: rc.cpp:81
msgid "HDD"
msgstr "HDD"
#. i18n: file: ui/configwindow.ui:612
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_hdd)
#: rc.cpp:85
#, no-c-format
msgid "@@/;@@ - mount point usage, %"
msgstr "@@/;@@ - mount point usage, %"
#. i18n: file: ui/configwindow.ui:660
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_hddTemp)
#: rc.cpp:88
msgid "HDD Temp"
msgstr "HDD Temp"
#. i18n: file: ui/configwindow.ui:670
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_hddTemp)
#: rc.cpp:91
msgid "@@/dev/sda@@ - physical temperature on /dev/sda"
msgstr "@@/dev/sda@@ - physical temperature on /dev/sda"
#. i18n: file: ui/configwindow.ui:718
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_net)
#: rc.cpp:94
msgid "Network"
msgstr "Network"
#. i18n: file: ui/configwindow.ui:730
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_net)
#: rc.cpp:97
msgid ""
"$net - network speed, down/up, KB/s\n"
"$netdev - current network device\n"
"@@eth0@@ - disable auto select device and set specified device"
msgstr ""
"$net - network speed, down/up, KB/s\n"
"$netdev - current network device\n"
"@@eth0@@ - disable auto select device and set specified device"
#. i18n: file: ui/configwindow.ui:778
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_bat)
#: rc.cpp:102
msgid "Battery"
msgstr "Battery"
#. i18n: file: ui/configwindow.ui:789
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_bat)
#: rc.cpp:106
#, no-c-format
msgid ""
"$bat - battery charge, %\n"
"$ac - AC status"
msgstr ""
"$bat - battery charge, %\n"
"$ac - AC status"
#. i18n: file: ui/configwindow.ui:853
#. i18n: ectx: property (text), widget (QLabel, label_batdev)
#: rc.cpp:110
msgid "Battery device"
msgstr "Battery device"
#. i18n: file: ui/configwindow.ui:860
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_batdev)
#: rc.cpp:113
msgid "\"/sys/class/power_supply/BAT0/capacity\" by default"
msgstr "\"/sys/class/power_supply/BAT0/capacity\" by default"
#. i18n: file: ui/configwindow.ui:896
#. i18n: ectx: property (text), widget (QLabel, label_acdev)
#: rc.cpp:116
msgid "AC device"
msgstr "AC device"
#. i18n: file: ui/configwindow.ui:903
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_acdev)
#: rc.cpp:119
msgid "\"/sys/class/power_supply/AC/online\" by default"
msgstr "\"/sys/class/power_supply/AC/online\" by default"
#. i18n: file: ui/configwindow.ui:923
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_player)
#: rc.cpp:122
msgid "Music player"
msgstr "Music player"
#. i18n: file: ui/configwindow.ui:940
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_player)
#: rc.cpp:125
msgid "amarok"
msgstr "amarok"
#. i18n: file: ui/configwindow.ui:945
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_player)
#: rc.cpp:128
msgid "mpd"
msgstr "mpd"
#. i18n: file: ui/configwindow.ui:950
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_player)
#: rc.cpp:131
msgid "qmmp"
msgstr "qmmp"
#. i18n: file: ui/configwindow.ui:962
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_player)
#: rc.cpp:134
msgid ""
"$album - song album\n"
"$artist - song artist\n"
"$progress - song progress\n"
"$time - song duration\n"
"$title - song title"
msgstr ""
"$album - song album\n"
"$artist - song artist\n"
"$progress - song progress\n"
"$time - song duration\n"
"$title - song title"
#. i18n: file: ui/configwindow.ui:1016
#. i18n: ectx: attribute (title), widget (QWidget, appearance)
#: rc.cpp:141
msgid "Appearance"
msgstr "Appearance"
#. i18n: file: ui/configwindow.ui:1030
#. i18n: ectx: property (text), widget (QLabel, label_interval)
#: rc.cpp:144
msgid "Time interval"
msgstr "Time interval"
#. i18n: file: ui/configwindow.ui:1085
#. i18n: ectx: property (text), widget (QLabel, label_font)
#: rc.cpp:147
msgid "Font"
msgstr "Font"
#. i18n: file: ui/configwindow.ui:1125
#. i18n: ectx: property (text), widget (QLabel, label_fontSize)
#: rc.cpp:150
msgid "Font size"
msgstr "Font size"
#. i18n: file: ui/configwindow.ui:1180
#. i18n: ectx: property (text), widget (QLabel, label_color)
#: rc.cpp:153
msgid "Font color"
msgstr "Font color"
#. i18n: file: ui/configwindow.ui:1220
#. i18n: ectx: property (text), widget (QLabel, label_style)
#: rc.cpp:156
msgid "Font style"
msgstr "Font style"
#. i18n: file: ui/configwindow.ui:1270
#. i18n: ectx: property (text), widget (QLabel, label_weight)
#: rc.cpp:159
msgid "Font weight"
msgstr "Font weight"
#: rc.cpp:160
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Evgeniy Alekseev"
#: rc.cpp:161
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "esalexeev@gmail.com"

View File

@ -0,0 +1,81 @@
#!/bin/sh
BASEDIR="../contents" # root of translatable sources
PROJECT="py-text-monitor" # project name
BUGADDR="http://kde-look.org/content/show.php?content=157124" # MSGID-Bugs
WDIR=`pwd` # working dir
SATELLITE_LIST=satellite.list
BACKGROUND_LIST=background.list
add_list()
{
LIST=$1
if [ -z "$LIST" ]
then
echo ">>ERR<< add_list() - missing parameter LIST - exiting"
return
fi
if [ -f "$LIST" ]
then
cat $LIST | while read ROW
do
echo "tr2i18n(\"${ROW}\")" >> ${WDIR}/rc.cpp
done
else
echo ">>ERR<< add_list() - file $LIST does not exist."
fi
}
echo "Preparing rc files"
cd ${BASEDIR}
# we use simple sorting to make sure the lines do not jump around too much from system to system
find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > ${WDIR}/rcfiles.list
xargs --arg-file=${WDIR}/rcfiles.list extractrc > ${WDIR}/rc.cpp
# additional string for KAboutData
echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp
echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp
cd ${WDIR}
# Add Satellite list
add_list "$SATELLITE_LIST"
# Add Background list
add_list "$BACKGROUND_LIST"
echo "Done preparing rc files"
echo "Extracting messages"
cd ${BASEDIR}
# see above on sorting
find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | sort > ${WDIR}/infiles.list
echo "rc.cpp" >> ${WDIR}/infiles.list
cd ${WDIR}
xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \
-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \
--msgid-bugs-address="${BUGADDR}" \
--files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${PROJECT}.pot || { echo "error while calling xgettext. aborting."; exit 1; }
echo "Done extracting messages"
echo "Merging translations"
catalogs=`find . -name '*.po'`
for cat in $catalogs; do
echo $cat
msgmerge -o $cat.new $cat ${PROJECT}.pot
mv $cat.new $cat
done
echo "Done merging translations"
echo "Cleaning up"
cd ${WDIR}
rm rcfiles.list
rm infiles.list
rm rc.cpp
echo "Done"

View File

@ -0,0 +1,330 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://kde-look.org/content/show.php?content=157124\n"
"POT-Creation-Date: 2014-03-30 13:27+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#. i18n: file: ui/configwindow.ui:32
#. i18n: ectx: property (windowTitle), widget (QWidget, ConfigWindow)
#: rc.cpp:3
msgid "Form"
msgstr ""
#. i18n: file: ui/configwindow.ui:42
#. i18n: ectx: attribute (title), widget (QWidget, settings)
#: rc.cpp:6
msgid "Widget settings"
msgstr ""
#. i18n: file: ui/configwindow.ui:56
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_time)
#: rc.cpp:9
msgid "Time"
msgstr ""
#. i18n: file: ui/configwindow.ui:75
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_time)
#: rc.cpp:12
msgid ""
"$time - time in default format\n"
"$isotime - time in ISO format\n"
"$shorttime - time in short format\n"
"$longtime - time in log format\n"
"$custom: $dddd - long weekday; $ddd - short weekday; $dd - day; $d day w\\o "
"zero; \n"
"\t$MMMM - long month; $MMM - short month; $MM - month; $M - month w\\o "
"zero; \n"
"\t$yyyy - year; $yy short year; \n"
"\t$hh - hours (24 only); $h - hours w\\o zero (24 only); \n"
"\t$mm - minutes; $m - minutes w\\o zero;\n"
"\t$ss - seconds; $s - seconds w\\o zero"
msgstr ""
#. i18n: file: ui/configwindow.ui:120
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_uptime)
#: rc.cpp:24
msgid "Uptime"
msgstr ""
#. i18n: file: ui/configwindow.ui:131
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_uptime)
#: rc.cpp:27
msgid ""
"$uptime - system uptime\n"
"$custom: $ds - uptime days; $hs - uptime hours; $ms - uptime minutes"
msgstr ""
#. i18n: file: ui/configwindow.ui:179
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_cpu)
#: rc.cpp:31
msgid "CPU"
msgstr ""
#. i18n: file: ui/configwindow.ui:190
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_cpu)
#: rc.cpp:35
#, no-c-format
msgid ""
"$cpu - total load CPU, %\n"
"$ccpu - load CPU for each core, %"
msgstr ""
#. i18n: file: ui/configwindow.ui:238
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_cpuclock)
#: rc.cpp:39
msgid "CPU Clock"
msgstr ""
#. i18n: file: ui/configwindow.ui:249
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_cpuclock)
#: rc.cpp:42
msgid ""
"$cpucl - average CPU clock, MHz\n"
"$ccpucl - CPU clock for each core, MHz"
msgstr ""
#. i18n: file: ui/configwindow.ui:297
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_temp)
#: rc.cpp:46
msgid "Temperature"
msgstr ""
#. i18n: file: ui/configwindow.ui:320
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_temp)
#: rc.cpp:49
msgid "$temp - physical temperature on CPU"
msgstr ""
#. i18n: file: ui/configwindow.ui:368
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_gpu)
#: rc.cpp:52
msgid "GPU"
msgstr ""
#. i18n: file: ui/configwindow.ui:378
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_gpu)
#: rc.cpp:56
#, no-c-format
msgid "$gpu - gpu usage, %"
msgstr ""
#. i18n: file: ui/configwindow.ui:426
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_gpuTemp)
#: rc.cpp:59
msgid "GPU Temp"
msgstr ""
#. i18n: file: ui/configwindow.ui:436
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_gpuTemp)
#: rc.cpp:62
msgid "$gputemp - physical temperature on GPU"
msgstr ""
#. i18n: file: ui/configwindow.ui:484
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_mem)
#: rc.cpp:65
msgid "Memory"
msgstr ""
#. i18n: file: ui/configwindow.ui:495
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_mem)
#: rc.cpp:69
#, no-c-format
msgid ""
"$mem - RAM usage, %\n"
"$memmb - RAM usage, MB"
msgstr ""
#. i18n: file: ui/configwindow.ui:543
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_swap)
#: rc.cpp:73
msgid "Swap"
msgstr ""
#. i18n: file: ui/configwindow.ui:554
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_swap)
#: rc.cpp:77
#, no-c-format
msgid ""
"$swap - swap usage, %\n"
"$swapmb - swap usage, MB"
msgstr ""
#. i18n: file: ui/configwindow.ui:602
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_hdd)
#: rc.cpp:81
msgid "HDD"
msgstr ""
#. i18n: file: ui/configwindow.ui:612
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_hdd)
#: rc.cpp:85
#, no-c-format
msgid "@@/;@@ - mount point usage, %"
msgstr ""
#. i18n: file: ui/configwindow.ui:660
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_hddTemp)
#: rc.cpp:88
msgid "HDD Temp"
msgstr ""
#. i18n: file: ui/configwindow.ui:670
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_hddTemp)
#: rc.cpp:91
msgid "@@/dev/sda@@ - physical temperature on /dev/sda"
msgstr ""
#. i18n: file: ui/configwindow.ui:718
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_net)
#: rc.cpp:94
msgid "Network"
msgstr ""
#. i18n: file: ui/configwindow.ui:730
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_net)
#: rc.cpp:97
msgid ""
"$net - network speed, down/up, KB/s\n"
"$netdev - current network device\n"
"@@eth0@@ - disable auto select device and set specified device"
msgstr ""
#. i18n: file: ui/configwindow.ui:778
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_bat)
#: rc.cpp:102
msgid "Battery"
msgstr ""
#. i18n: file: ui/configwindow.ui:789
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_bat)
#: rc.cpp:106
#, no-c-format
msgid ""
"$bat - battery charge, %\n"
"$ac - AC status"
msgstr ""
#. i18n: file: ui/configwindow.ui:853
#. i18n: ectx: property (text), widget (QLabel, label_batdev)
#: rc.cpp:110
msgid "Battery device"
msgstr ""
#. i18n: file: ui/configwindow.ui:860
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_batdev)
#: rc.cpp:113
msgid "\"/sys/class/power_supply/BAT0/capacity\" by default"
msgstr ""
#. i18n: file: ui/configwindow.ui:896
#. i18n: ectx: property (text), widget (QLabel, label_acdev)
#: rc.cpp:116
msgid "AC device"
msgstr ""
#. i18n: file: ui/configwindow.ui:903
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_acdev)
#: rc.cpp:119
msgid "\"/sys/class/power_supply/AC/online\" by default"
msgstr ""
#. i18n: file: ui/configwindow.ui:923
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_player)
#: rc.cpp:122
msgid "Music player"
msgstr ""
#. i18n: file: ui/configwindow.ui:940
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_player)
#: rc.cpp:125
msgid "amarok"
msgstr ""
#. i18n: file: ui/configwindow.ui:945
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_player)
#: rc.cpp:128
msgid "mpd"
msgstr ""
#. i18n: file: ui/configwindow.ui:950
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_player)
#: rc.cpp:131
msgid "qmmp"
msgstr ""
#. i18n: file: ui/configwindow.ui:962
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_player)
#: rc.cpp:134
msgid ""
"$album - song album\n"
"$artist - song artist\n"
"$progress - song progress\n"
"$time - song duration\n"
"$title - song title"
msgstr ""
#. i18n: file: ui/configwindow.ui:1016
#. i18n: ectx: attribute (title), widget (QWidget, appearance)
#: rc.cpp:141
msgid "Appearance"
msgstr ""
#. i18n: file: ui/configwindow.ui:1030
#. i18n: ectx: property (text), widget (QLabel, label_interval)
#: rc.cpp:144
msgid "Time interval"
msgstr ""
#. i18n: file: ui/configwindow.ui:1085
#. i18n: ectx: property (text), widget (QLabel, label_font)
#: rc.cpp:147
msgid "Font"
msgstr ""
#. i18n: file: ui/configwindow.ui:1125
#. i18n: ectx: property (text), widget (QLabel, label_fontSize)
#: rc.cpp:150
msgid "Font size"
msgstr ""
#. i18n: file: ui/configwindow.ui:1180
#. i18n: ectx: property (text), widget (QLabel, label_color)
#: rc.cpp:153
msgid "Font color"
msgstr ""
#. i18n: file: ui/configwindow.ui:1220
#. i18n: ectx: property (text), widget (QLabel, label_style)
#: rc.cpp:156
msgid "Font style"
msgstr ""
#. i18n: file: ui/configwindow.ui:1270
#. i18n: ectx: property (text), widget (QLabel, label_weight)
#: rc.cpp:159
msgid "Font weight"
msgstr ""
#: rc.cpp:160
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr ""
#: rc.cpp:161
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr ""

365
sources/ptm/po/ru.po Normal file
View File

@ -0,0 +1,365 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Evgeniy Alekseev <esalexeev@gmail.com>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: http://kde-look.org/content/show.php?content=157124\n"
"POT-Creation-Date: 2014-03-30 13:27+0400\n"
"PO-Revision-Date: 2014-03-30 13:40+0400\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: Russian <kde-russian@lists.kde.ru>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<"
"=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 1.5\n"
#. i18n: file: ui/configwindow.ui:32
#. i18n: ectx: property (windowTitle), widget (QWidget, ConfigWindow)
#: rc.cpp:3
msgid "Form"
msgstr "Form"
#. i18n: file: ui/configwindow.ui:42
#. i18n: ectx: attribute (title), widget (QWidget, settings)
#: rc.cpp:6
msgid "Widget settings"
msgstr "Настройки виджета"
#. i18n: file: ui/configwindow.ui:56
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_time)
#: rc.cpp:9
msgid "Time"
msgstr "Время"
#. i18n: file: ui/configwindow.ui:75
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_time)
#: rc.cpp:12
msgid ""
"$time - time in default format\n"
"$isotime - time in ISO format\n"
"$shorttime - time in short format\n"
"$longtime - time in log format\n"
"$custom: $dddd - long weekday; $ddd - short weekday; $dd - day; $d day w\\o "
"zero; \n"
"\t$MMMM - long month; $MMM - short month; $MM - month; $M - month w\\o "
"zero; \n"
"\t$yyyy - year; $yy short year; \n"
"\t$hh - hours (24 only); $h - hours w\\o zero (24 only); \n"
"\t$mm - minutes; $m - minutes w\\o zero;\n"
"\t$ss - seconds; $s - seconds w\\o zero"
msgstr ""
"$time - время в стандартном формате\n"
"$isotime - время ISO формате\n"
"$shorttime - время в коротком формате\n"
"$longtime - время в длинном формате\n"
"$custom: $dddd - день недели (длинный); $ddd - день недели (короткий); $dd - "
"день; $d - день без 0; \n"
"\t$MMMM - месяц (длинный); $MMM - месяц (короткий); $MM - месяц; $M - месяц "
"без 0; \n"
"\t$yyyy - год; $yy - год (короткий); \n"
"\t$hh - часы (24); $h - часы без 0 (24); \n"
"\t$mm - минуты; $m - минуты без 0;\n"
"\t$ss - секунды; $s - секунды без 0"
#. i18n: file: ui/configwindow.ui:120
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_uptime)
#: rc.cpp:24
msgid "Uptime"
msgstr "Аптайм"
#. i18n: file: ui/configwindow.ui:131
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_uptime)
#: rc.cpp:27
msgid ""
"$uptime - system uptime\n"
"$custom: $ds - uptime days; $hs - uptime hours; $ms - uptime minutes"
msgstr ""
"$uptime - аптайм системы\n"
"$custom: $ds - дни аптайма; $hs - часы аптайма; $ms - минуты аптайма"
#. i18n: file: ui/configwindow.ui:179
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_cpu)
#: rc.cpp:31
msgid "CPU"
msgstr "CPU"
#. i18n: file: ui/configwindow.ui:190
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_cpu)
#: rc.cpp:35
#, no-c-format
msgid ""
"$cpu - total load CPU, %\n"
"$ccpu - load CPU for each core, %"
msgstr ""
"$cpu - общая загрузка CPU, %\n"
"$ccpu - загрузка CPU для каждого ядра, %"
#. i18n: file: ui/configwindow.ui:238
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_cpuclock)
#: rc.cpp:39
msgid "CPU Clock"
msgstr "Частота CPU"
#. i18n: file: ui/configwindow.ui:249
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_cpuclock)
#: rc.cpp:42
msgid ""
"$cpucl - average CPU clock, MHz\n"
"$ccpucl - CPU clock for each core, MHz"
msgstr ""
"$cpucl - средняя частота CPU, MHz\n"
"$ccpucl - частота CPU для каждого ядра, MHz"
#. i18n: file: ui/configwindow.ui:297
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_temp)
#: rc.cpp:46
msgid "Temperature"
msgstr "Температура"
#. i18n: file: ui/configwindow.ui:320
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_temp)
#: rc.cpp:49
msgid "$temp - physical temperature on CPU"
msgstr "$temp - физическая температура на CPU"
#. i18n: file: ui/configwindow.ui:368
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_gpu)
#: rc.cpp:52
msgid "GPU"
msgstr "GPU"
#. i18n: file: ui/configwindow.ui:378
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_gpu)
#: rc.cpp:56
#, no-c-format
msgid "$gpu - gpu usage, %"
msgstr "$gpu - использование GPU, %"
#. i18n: file: ui/configwindow.ui:426
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_gpuTemp)
#: rc.cpp:59
msgid "GPU Temp"
msgstr "Температура GPU"
#. i18n: file: ui/configwindow.ui:436
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_gpuTemp)
#: rc.cpp:62
msgid "$gputemp - physical temperature on GPU"
msgstr "$gputemp - физическая температура на GPU"
#. i18n: file: ui/configwindow.ui:484
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_mem)
#: rc.cpp:65
msgid "Memory"
msgstr "Память"
#. i18n: file: ui/configwindow.ui:495
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_mem)
#: rc.cpp:69
#, no-c-format
msgid ""
"$mem - RAM usage, %\n"
"$memmb - RAM usage, MB"
msgstr ""
"$mem - использование RAM, %\n"
"$memmb - использование RAM, MB"
#. i18n: file: ui/configwindow.ui:543
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_swap)
#: rc.cpp:73
msgid "Swap"
msgstr "Swap"
#. i18n: file: ui/configwindow.ui:554
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_swap)
#: rc.cpp:77
#, no-c-format
msgid ""
"$swap - swap usage, %\n"
"$swapmb - swap usage, MB"
msgstr ""
"$swap - использование swap, %\n"
"$swapmb - использование swap, MB"
#. i18n: file: ui/configwindow.ui:602
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_hdd)
#: rc.cpp:81
msgid "HDD"
msgstr "HDD"
#. i18n: file: ui/configwindow.ui:612
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_hdd)
#: rc.cpp:85
#, no-c-format
msgid "@@/;@@ - mount point usage, %"
msgstr "@@/;@@ - использование точки монтирование, %"
#. i18n: file: ui/configwindow.ui:660
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_hddTemp)
#: rc.cpp:88
msgid "HDD Temp"
msgstr "Температура HDD"
#. i18n: file: ui/configwindow.ui:670
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_hddTemp)
#: rc.cpp:91
msgid "@@/dev/sda@@ - physical temperature on /dev/sda"
msgstr "@@/dev/sda@@ - физическая температура /dev/sda"
#. i18n: file: ui/configwindow.ui:718
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_net)
#: rc.cpp:94
msgid "Network"
msgstr "Сеть"
#. i18n: file: ui/configwindow.ui:730
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_net)
#: rc.cpp:97
msgid ""
"$net - network speed, down/up, KB/s\n"
"$netdev - current network device\n"
"@@eth0@@ - disable auto select device and set specified device"
msgstr ""
"$net - скорость передачи данных, down/up, KB/s\n"
"$netdev - используемое устройство\n"
"@@eth0@@ - отключить автовыбор устройства и установить указанное"
#. i18n: file: ui/configwindow.ui:778
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_bat)
#: rc.cpp:102
msgid "Battery"
msgstr "Батарея"
#. i18n: file: ui/configwindow.ui:789
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_bat)
#: rc.cpp:106
#, no-c-format
msgid ""
"$bat - battery charge, %\n"
"$ac - AC status"
msgstr ""
"$bat - заряд батареи, %\n"
"$ac - статус адаптора питания"
#. i18n: file: ui/configwindow.ui:853
#. i18n: ectx: property (text), widget (QLabel, label_batdev)
#: rc.cpp:110
msgid "Battery device"
msgstr "Устройство батареи"
#. i18n: file: ui/configwindow.ui:860
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_batdev)
#: rc.cpp:113
msgid "\"/sys/class/power_supply/BAT0/capacity\" by default"
msgstr "\"/sys/class/power_supply/BAT0/capacity\" по умолчанию"
#. i18n: file: ui/configwindow.ui:896
#. i18n: ectx: property (text), widget (QLabel, label_acdev)
#: rc.cpp:116
msgid "AC device"
msgstr "Устройство AC"
#. i18n: file: ui/configwindow.ui:903
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_acdev)
#: rc.cpp:119
msgid "\"/sys/class/power_supply/AC/online\" by default"
msgstr "\"/sys/class/power_supply/AC/online\" по умолчанию"
#. i18n: file: ui/configwindow.ui:923
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_player)
#: rc.cpp:122
msgid "Music player"
msgstr "Музыкальный плеер"
#. i18n: file: ui/configwindow.ui:940
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_player)
#: rc.cpp:125
msgid "amarok"
msgstr "amarok"
#. i18n: file: ui/configwindow.ui:945
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_player)
#: rc.cpp:128
msgid "mpd"
msgstr "mpd"
#. i18n: file: ui/configwindow.ui:950
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_player)
#: rc.cpp:131
msgid "qmmp"
msgstr "qmmp"
#. i18n: file: ui/configwindow.ui:962
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_player)
#: rc.cpp:134
msgid ""
"$album - song album\n"
"$artist - song artist\n"
"$progress - song progress\n"
"$time - song duration\n"
"$title - song title"
msgstr ""
"$album - альбом\n"
"$artist - исполнитель\n"
"$progress - прогресс\n"
"$time - продолжительность\n"
"$title - название"
#. i18n: file: ui/configwindow.ui:1016
#. i18n: ectx: attribute (title), widget (QWidget, appearance)
#: rc.cpp:141
msgid "Appearance"
msgstr "Внешний вид"
#. i18n: file: ui/configwindow.ui:1030
#. i18n: ectx: property (text), widget (QLabel, label_interval)
#: rc.cpp:144
msgid "Time interval"
msgstr "Интервал обновления"
#. i18n: file: ui/configwindow.ui:1085
#. i18n: ectx: property (text), widget (QLabel, label_font)
#: rc.cpp:147
msgid "Font"
msgstr "Шрифт"
#. i18n: file: ui/configwindow.ui:1125
#. i18n: ectx: property (text), widget (QLabel, label_fontSize)
#: rc.cpp:150
msgid "Font size"
msgstr "Размер шрифта"
#. i18n: file: ui/configwindow.ui:1180
#. i18n: ectx: property (text), widget (QLabel, label_color)
#: rc.cpp:153
msgid "Font color"
msgstr "Цвет шрифта"
#. i18n: file: ui/configwindow.ui:1220
#. i18n: ectx: property (text), widget (QLabel, label_style)
#: rc.cpp:156
msgid "Font style"
msgstr "Стиль шрифта"
#. i18n: file: ui/configwindow.ui:1270
#. i18n: ectx: property (text), widget (QLabel, label_weight)
#: rc.cpp:159
msgid "Font weight"
msgstr "Ширина шрифта"
#: rc.cpp:160
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Evgeniy Alekseev"
#: rc.cpp:161
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "esalexeev@gmail.com"