![]() Global Moderator ![]()
|
Hi,
remember KDE 3's kthinkbat? It displayed all sorts of info about your battery. The current indicator gives one the percentage but not time remaining or anything else. To the rescue tp_smapi (at least for thinkpad owners). Below a list of available info for your battery:
Now the question - can this be incorporated into the current KDE power management? I could of course simply make aliases and bang them into my .bashrc or even write a script listing the above, but I'd dearly love to just move the mouse over my battery indicator in the task bar and have this info come up. Any pointers as to how? PS.: Hope I'm in the right sub forum for this... Thanks for your attention!
Debian testing
|
![]() KDE Developer ![]()
|
Would you really want all that information everytime you moused over the battery indicator? Sure, you might want to see the manufacturer and serial ID, but not /every/ time you mouse over the panel trying to see how much battery life you have left.
My suggestion: maybe this should be a seperate window in the system settings panel? Also have a look and see how much of that information is presented over DBUS (I think all of it). Look in the systembus in qdbusviewer. If you come up with a design which is really usable whilst making it still easy to view the battery status in the battery indicator. I'll gladly give you some pointers coding it up. Dave |
![]() Global Moderator ![]()
|
Cheers,
nope, not all of it, that would literally be a blinder ![]() I was trying to avoid a separate anything really, be it a battery monitor or a window in the systemsettings panel as this is only info which goes on top of the existing power management... Hm, I haven't found it, but then that thing is alien to me and I am not sure at all what it all means ![]()
Okay, you move your mouse over the power management icon in the systray. Current behaviour: nothing happens Proposed behaviour: remaining time to charge/discharge and current power consumption is displayed by default To adjust what is displayed go into systemsettings - power management - new field on the left called "Mouse" or "Mouseover" or some such with one tab which displays all available settings but only the default ones are ticked. Does that make sense?
Debian testing
|
![]() KDE Developer ![]()
|
Yep, I think we're fairly agreed. I'm all for the the extra panel in the power management of system settings (or perhaps kinfocenter), and personally I'd really like to see a few other things like "time remaining" when I mouse over the panel.
Updating the plasmoid, and editing systemsettings/kinfocenter are effectively two entirely separate pieces of code. IMHO - we should delay putting in customisation of the plasmoid, to avoid trying to do too much at once. Only a few features "power remaining" is exposed to the KDE's hardware library (solid) - not all of the features above. We need to skip this and talk directly to HAL (via DBUS) because of this it's unlikely to be part of KDE SC as it won't work on Windows etc). However, We should still be able to come up with a cloned applet with more features that we can put on kde-apps/kde-look. I've got a few other projects on the go, but I'll try and knock up some sort of demo: Edit: Looks like all the information is presented across DBUS ok: copy this code into a python shell. import dbus bus = dbus.SystemBus() hal_manager_obj = bus.get_object("org.freedesktop.Hal","/org/freedesktop/Hal/Manager") hal_manager = dbus.Interface(hal_manager_obj, "org.freedesktop.Hal.Manager") batPath = hal_manager.FindDeviceByCapability("battery") bat = bus.get_object("org.freedesktop.Hal", batPath[0]) bat.GetAllProperties(dbus_interface="org.freedesktop.Hal.Device") I propose step1: we start at a template Qt program - and covert the code above into C++/QtBus, and have it printing all the properties to standard out. http://doc.qt.nokia.com/4.6//qtdbus.html . We can then move this code about later. I'd probably use QtCreator to get an application started quickly. DBUS can be confusing at first - have a go, but don't worry if you don't get anywhere. |
![]() Global Moderator ![]()
|
Wow! Did as you suggested and it appears to be working
![]()
Your proposed step1 sounds as though we'd be creating an extra entry in systemsettings. So you don't like the idea of incorporating this info into the power management module? Would seem to be the natural kind of place for me, but in the end I don't really mind ![]() Will install QTCreator but I am no programmer, no designer, no nothing IT, so bear with me...
Debian testing
|
![]() KDE Developer ![]()
|
Step 1 is just checking we can do it, and being able to have some code we can copy and paste into whatever we decide to edit.
It's far easier to modify some existing code if you know what you're going to modify it to, and know exactly how to extract various bits of information. Now for explanation of what that python script did. - Connect to the system bus - query HAL to ask for a list of paths to all batteries - query that path for all information Step1.1 is just to reproduce the first 2 steps in Qt The goal being to print a line that looks like '/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT0' Make sure you read the introduction to DBUS linked to last time. For the first query: service = "org.freedesktop.Hal" path = "/org/freedesktop/Hal/Manager") interface = "org.freedesktop.Hal.Manager" method = "findAllDevicesByCapability" As I said DBus code is rather confusing, so here's what I think the first step is. in untested Qt:
|
![]() Global Moderator ![]()
|
Thank you very much for your help, but it is not enough for me or rather I haven't got the foggiest what I am supposed to do to dbus code, qt and qtcreator. It is little more than complete and utter gobbledegook
![]() So, I've tried and failed. Instead I wrote myself a little script (well, little more than a bunch of echo commands) and put an alias in my .bashrc so I have detailed battery info at my disposal. Not as easy as moving the battery over the power manager, but at least I was able to do it ![]() It'd be great to see this function at some stage in the future, but sadly I am no programmer (gimme literature, but not code!). Cheers and many thanks - croak.
Debian testing
|
![]() KDE Developer ![]()
|
No worries. Thanks for at least having a go.
If I find time to make a better battery applet, would you be a tester for me? |
![]() Global Moderator ![]()
|
yepyepyepyepyep
![]()
Debian testing
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]