mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-06 18:35:52 +00:00
release 1.5.3
This commit is contained in:
@ -21,6 +21,7 @@ from PyQt4.QtGui import *
|
||||
from PyKDE4.plasma import Plasma
|
||||
from PyKDE4 import plasmascript
|
||||
|
||||
import datetime
|
||||
|
||||
|
||||
class DataEngine:
|
||||
@ -255,21 +256,34 @@ class DataEngine:
|
||||
self.parent.label_hddtemp.setText(text)
|
||||
elif (sourceName == "player"):
|
||||
if (self.parent.player_name == 0):
|
||||
title = str(data[QString(u'amarok_title')])
|
||||
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):
|
||||
title = str(data[QString(u'mpd_title')])
|
||||
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):
|
||||
title = str(data[QString(u'qmmp_title')])
|
||||
album = str(data[QString(u'qmmp_album')])
|
||||
artist = str(data[QString(u'qmmp_artist')])
|
||||
if (self.parent.playerFormat.split('$artist')[0] != self.parent.playerFormat):
|
||||
if ((len(artist) + len(title)) > 10):
|
||||
line = self.parent.playerFormat.split('$artist')[0] + artist[:5] + u"…" + self.parent.playerFormat.split('$artist')[1]
|
||||
else:
|
||||
line = self.parent.playerFormat.split('$artist')[0] + artist + self.parent.playerFormat.split('$artist')[1]
|
||||
else:
|
||||
line = self.parent.playerFormat
|
||||
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') != 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]
|
||||
|
@ -116,6 +116,7 @@ class pyTextWidget(plasmascript.Applet):
|
||||
# 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',
|
||||
|
@ -298,12 +298,17 @@ class Reinit():
|
||||
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)
|
||||
if (self.parent.playerFormat.split('$artist')[0] != self.parent.playerFormat):
|
||||
line = self.parent.playerFormat.split('$artist')[0] + '----------' + self.parent.playerFormat.split('$artist')[1]
|
||||
else:
|
||||
line = self.parent.playerFormat
|
||||
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] + '----------' + line.split('$title')[1]
|
||||
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)
|
||||
|
Reference in New Issue
Block a user