mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-25 07:57:19 +00:00
changes in formatLine variable
This commit is contained in:
parent
9ba7a2b0d5
commit
14fab265cd
@ -303,7 +303,7 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
except:
|
except:
|
||||||
bat = "(?)"
|
bat = "(?)"
|
||||||
line = line.split('$ac')[0] + bat + line.split('$ac')[1]
|
line = line.split('$ac')[0] + bat + line.split('$ac')[1]
|
||||||
text = self.ptm['vars']['app']['format'].split('$LINE')[0] + line + self.ptm['vars']['app']['format'].split('$LINE')[1]
|
text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
|
||||||
self.setText("bat", text)
|
self.setText("bat", text)
|
||||||
|
|
||||||
|
|
||||||
@ -320,7 +320,7 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
if (line.split('$cpu')[0] != line):
|
if (line.split('$cpu')[0] != line):
|
||||||
value = "%5.1f" % (self.ptm['values']['cpu'][-1])
|
value = "%5.1f" % (self.ptm['values']['cpu'][-1])
|
||||||
line = line.split('$cpu')[0] + value + line.split('$cpu')[1]
|
line = line.split('$cpu')[0] + value + line.split('$cpu')[1]
|
||||||
text = self.ptm['vars']['app']['format'].split('$LINE')[0] + line + self.ptm['vars']['app']['format'].split('$LINE')[1]
|
text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
|
||||||
self.setText("cpu", text)
|
self.setText("cpu", text)
|
||||||
|
|
||||||
|
|
||||||
@ -337,7 +337,7 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
if (line.split('$cpucl')[0] != line):
|
if (line.split('$cpucl')[0] != line):
|
||||||
value = "%4.0f" % (self.ptm['values']['cpuclock'][-1])
|
value = "%4.0f" % (self.ptm['values']['cpuclock'][-1])
|
||||||
line = line.split('$cpucl')[0] + value + line.split('$cpucl')[1]
|
line = line.split('$cpucl')[0] + value + line.split('$cpucl')[1]
|
||||||
text = self.ptm['vars']['app']['format'].split('$LINE')[0] + line + self.ptm['vars']['app']['format'].split('$LINE')[1]
|
text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
|
||||||
self.setText("cpuclock", text)
|
self.setText("cpuclock", text)
|
||||||
|
|
||||||
|
|
||||||
@ -347,7 +347,7 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
for i in range(len(self.ptm['names']['hdd'])).reverse():
|
for i in range(len(self.ptm['names']['hdd'])).reverse():
|
||||||
if (line.split('$hdd' + str(i))[0] != line):
|
if (line.split('$hdd' + str(i))[0] != line):
|
||||||
line = line.split('$hdd' + str(i))[0] + str(self.ptm['values']['hdd'][self.ptm['names']['hdd'][i]]) + line.split('$hdd' + str(i))[1]
|
line = line.split('$hdd' + str(i))[0] + str(self.ptm['values']['hdd'][self.ptm['names']['hdd'][i]]) + line.split('$hdd' + str(i))[1]
|
||||||
text = self.ptm['vars']['app']['format'].split('$LINE')[0] + line + self.ptm['vars']['app']['format'].split('$LINE')[1]
|
text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
|
||||||
self.setText("hdd", text)
|
self.setText("hdd", text)
|
||||||
|
|
||||||
|
|
||||||
@ -357,7 +357,7 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
for i in range(len(self.ptm['names']['hddtemp'])).reverse():
|
for i in range(len(self.ptm['names']['hddtemp'])).reverse():
|
||||||
if (line.split('$hddtemp' + str(i))[0] != line):
|
if (line.split('$hddtemp' + str(i))[0] != line):
|
||||||
line = line.split('$hddtemp' + str(i))[0] + self.ptm['values']['hddtemp'][self.ptm['names']['hddtemp'][i]] + line.split('$hddtemp' + str(i))[1]
|
line = line.split('$hddtemp' + str(i))[0] + self.ptm['values']['hddtemp'][self.ptm['names']['hddtemp'][i]] + line.split('$hddtemp' + str(i))[1]
|
||||||
text = self.ptm['vars']['app']['format'].split('$LINE')[0] + line + self.ptm['vars']['app']['format'].split('$LINE')[1]
|
text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
|
||||||
self.setText("hddtemp", text)
|
self.setText("hddtemp", text)
|
||||||
|
|
||||||
|
|
||||||
@ -377,7 +377,7 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
except:
|
except:
|
||||||
mem = " N\\A"
|
mem = " N\\A"
|
||||||
line = line.split('$mem')[0] + mem + line.split('$mem')[1]
|
line = line.split('$mem')[0] + mem + line.split('$mem')[1]
|
||||||
text = self.ptm['vars']['app']['format'].split('$LINE')[0] + line + self.ptm['vars']['app']['format'].split('$LINE')[1]
|
text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
|
||||||
self.setText("mem", text)
|
self.setText("mem", text)
|
||||||
|
|
||||||
|
|
||||||
@ -392,7 +392,7 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
if (line.split('$up')[0] != line):
|
if (line.split('$up')[0] != line):
|
||||||
value = "%4.0f" %(self.ptm['values']['net']['up'])
|
value = "%4.0f" %(self.ptm['values']['net']['up'])
|
||||||
line = line.split('$up')[0] + value + line.split('$up')[1]
|
line = line.split('$up')[0] + value + line.split('$up')[1]
|
||||||
text = self.ptm['vars']['app']['format'].split('$LINE')[0] + line + self.ptm['vars']['app']['format'].split('$LINE')[1]
|
text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
|
||||||
self.setText("net", text)
|
self.setText("net", text)
|
||||||
|
|
||||||
|
|
||||||
@ -412,7 +412,7 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
except:
|
except:
|
||||||
mem = " N\\A"
|
mem = " N\\A"
|
||||||
line = line.split('$swap')[0] + mem + line.split('$swap')[1]
|
line = line.split('$swap')[0] + mem + line.split('$swap')[1]
|
||||||
text = self.ptm['vars']['app']['format'].split('$LINE')[0] + line + self.ptm['vars']['app']['format'].split('$LINE')[1]
|
text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
|
||||||
self.setText("swap", text)
|
self.setText("swap", text)
|
||||||
|
|
||||||
|
|
||||||
@ -422,7 +422,7 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
for i in range(len(self.ptm['names']['temp'])).reverse():
|
for i in range(len(self.ptm['names']['temp'])).reverse():
|
||||||
if (line.split('$temp' + str(i))[0] != line):
|
if (line.split('$temp' + str(i))[0] != line):
|
||||||
line = line.split('$temp' + str(i))[0] + self.ptm['values']['temp'][self.ptm['names']['temp'][i]] + line.split('$temp' + str(i))[1]
|
line = line.split('$temp' + str(i))[0] + self.ptm['values']['temp'][self.ptm['names']['temp'][i]] + line.split('$temp' + str(i))[1]
|
||||||
text = self.ptm['vars']['app']['format'].split('$LINE')[0] + line + self.ptm['vars']['app']['format'].split('$LINE')[1]
|
text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
|
||||||
self.setText("temp", text)
|
self.setText("temp", text)
|
||||||
|
|
||||||
|
|
||||||
@ -543,7 +543,7 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
line = line.split('$uptime')[0] + text + line.split('$uptime')[1]
|
line = line.split('$uptime')[0] + text + line.split('$uptime')[1]
|
||||||
elif (line.split('$custom')[0] != line):
|
elif (line.split('$custom')[0] != line):
|
||||||
line = line.split('$custom')[0] + text + line.split('$custom')[1]
|
line = line.split('$custom')[0] + text + line.split('$custom')[1]
|
||||||
output = self.ptm['vars']['app']['format'].split('$LINE')[0] + line + self.ptm['vars']['app']['format'].split('$LINE')[1]
|
output = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,10 +46,10 @@ class Reinit():
|
|||||||
ptmVars['adv']['player'] = str(settings.get('player_name', "amarok"))
|
ptmVars['adv']['player'] = str(settings.get('player_name', "amarok"))
|
||||||
|
|
||||||
ptmVars['app'] = {}
|
ptmVars['app'] = {}
|
||||||
ptmVars['app']['format'] = "<pre><p align=\"center\"><span style=\" font-family:'" + str(settings.get('font_family', 'Terminus')) +\
|
ptmVars['app']['format'] = ["<pre><p align=\"center\"><span style=\" font-family:'" + str(settings.get('font_family', 'Terminus')) +\
|
||||||
"'; font-style:" + str(settings.get('font_style', 'normal')) + "; font-size:" + str(settings.get('font_size', 12)) +\
|
"'; font-style:" + str(settings.get('font_style', 'normal')) + "; font-size:" + str(settings.get('font_size', 12)) +\
|
||||||
"pt; font-weight:" + str(settings.get('font_weight', 400)) + "; color:" + str(settings.get('font_color', '#000000')) +\
|
"pt; font-weight:" + str(settings.get('font_weight', 400)) + "; color:" + str(settings.get('font_color', '#000000')) +\
|
||||||
";\">$LINE</span></p></pre>"
|
";\">", "</span></p></pre>"]
|
||||||
ptmVars['app']['interval'] = settings.get('interval', 2000).toInt()[0]
|
ptmVars['app']['interval'] = settings.get('interval', 2000).toInt()[0]
|
||||||
ptmVars['app']['order'] = str(settings.get('label_order', '1345'))
|
ptmVars['app']['order'] = str(settings.get('label_order', '1345'))
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ class Reinit():
|
|||||||
label = self.defaults['order'][order]
|
label = self.defaults['order'][order]
|
||||||
if (ptmVars['bools'][label] > 0):
|
if (ptmVars['bools'][label] > 0):
|
||||||
ptmVars['formats'][label] = str(settings.get(self.defaults['confFormat'][label], self.defaults['format'][label]))
|
ptmVars['formats'][label] = str(settings.get(self.defaults['confFormat'][label], self.defaults['format'][label]))
|
||||||
text = ptmVars['app']['format'].split('$LINE')[0] + ptmVars['formats'][label] + ptmVars['app']['format'].split('$LINE')[1]
|
text = ptmVars['app']['format'][0] + ptmVars['formats'][label] + ptmVars['app']['format'][1]
|
||||||
self.parent.addLabel(label, text, True)
|
self.parent.addLabel(label, text, True)
|
||||||
if ((label in ['cpu', 'cpuclock', 'mem', 'net', 'swap']) and (ptmVars['bools'][label] == 2)):
|
if ((label in ['cpu', 'cpuclock', 'mem', 'net', 'swap']) and (ptmVars['bools'][label] == 2)):
|
||||||
if (label == 'net'):
|
if (label == 'net'):
|
||||||
|
Loading…
Reference in New Issue
Block a user