mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-14 22:35:49 +00:00
New release 1.1.4
widget: * changed parsing acpi output
This commit is contained in:
@ -465,7 +465,7 @@ class pyTextWidget(plasmascript.Applet):
|
||||
def batText(self):
|
||||
"""function to set battery text"""
|
||||
commandOut = commands.getoutput("acpi")
|
||||
bat = "%3s" % (commandOut.split()[3].split("%")[0])
|
||||
bat = "%3s" % (commandOut.split(':')[1].split()[1].split('%')[0])
|
||||
line = self.batFormat.split('$bat')[0] + bat + self.batFormat.split('$bat')[1]
|
||||
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
|
||||
self.label_bat.setText(text)
|
||||
|
Reference in New Issue
Block a user