Unsolved How to get remaining battery percentage in sddm environment?
-
I am using kubuntu 19.04 and have installed this custom login screen:
https://github.com/RadRussianRus/sddm-slice
right now I am trying to figure out some way to add battery indicator at the bottom but I have no experience with Qt or QML. By now I have written the following code in Main.qml file :SlicedButton { id: batteryStatus x: buttonKeyboardLayout.x + buttonKeyboardLayout.widthPartial + 3 y: areaBottom.height - height - 5 function updateBatteryStatus() { text = /* Code to get battery status */ } font: fonts.slicesBottomLeft }
please guide me.
-
@Danial Hello and welcome to our forum :D
Check here maybe?
Creating Battery Level Indicator in Qt/QML using Icon Font
You will probably have 1-hour post cooldown, so you can PM me if the link doesn't help. -
@closx thanks for the quick response. I've looked into the article and I think that this article is about creating a dynamic battery icon but It doesn't tell us how to get actual system battery percentage. I am looking for that. It would be great if you could help me with that.
Thanks
-
hi
@Danial said in How to get remaining battery percentage in sddm environment?:get actual system battery percentage
one way to do that is to have a cmd script and run it using QProcess, you can then read the output of your command