Closed louies0623 closed 3 years ago
I made a battery applet a long time ago!
But not a PR...
@linuxkettle thank you very much, I found it at https://github.com/linuxkettle/Utilities/tree/battery-status-icon/System and wlll check it out!
This does NOT need to be run on startup, as I haven't an idea how it'll behave on PCs that don't have batteries. If anyone has such a PC, please test to see what happens.
This:
Should be easy to wrap it in a try:
except:
statement:
class BatteryApplet(QObject):
def refresh(self):
battery = psutil.sensors_battery()
try:
seconds = battery.secsleft
except:
sys.stderr.write("No battery found in this computer")
exit(1)
Works for me.
This applet depends on the python psutil module, which is installed by default in helloSystem to satisfy the requirements of another package, although I'm not sure which one.
Typing h psutil
in the Falkon browser address bar brings up:
desktop2app
command needs psutil
for watching the filesystempsutil
tooOkay. Thanks :)
...added: https://github.com/helloSystem/Utilities/commit/6877579ed2ed5a428b22a52746351a9088a85b6f Thanks @linuxkettle Will be on the next experimental ISOs, build 0F27+.
Is this closed now?
...once @louies0623 confirms that it is working for him :)
There is a display icon, this is a great start. Next is the realization of the menu
The only thing stopping that is that you can't put text in the system tray, like the percentage. Click on the menubar so that search goes blue, then hover the mouse over the battery icon for now.
I can confirm that this works very nicely for me on an Acer TravelMate B. :+1:
How about this?
Looks good.
It'll be easier not having to click the menubar then do the mouse hover thing, but I hope there's a way to at some point implement more sophisticated tray icons that can show the battery percentage etc. Then we could decouple the clock and simplify it a bit, and add settings and stuff.
Ayatana comes to mind.
I don't think text instead/in addition to an icon is possible using QSystemTrayIcon.
Closing this issue as implemented. Feel free to open new issues for further refinements.
Maybe I could have a closer look at Ayatana.
It will be more comfortable to turn the battery icon 90° to the right.
That's up to elementary-xfce to do that.
We are using an older version of their icon set, so it is unlikely to be changed there. But we can ship our own icon as part of the .app
bundle and use that, independently of the icon theme.
When the laptop has no power supply, it can display the current battery level