Help - Search - Members - Calendar
Full Version: Power Management
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > pdaXrom
karlto
Hi all

Matchbox has some shortcomings, but that's OK because there are plenty of other choices on pdaXrom!

However, there is one thing that Matchbox does that other window managers seem to lack entirely - power management for switching between power modes, backlighting etc. The light and power config applet sets up AC power and battery modes, and selects the right one whenever run (it is run initially in most .xinitrc files). From there, Matchbox will continue to monitor changes in power status and change modes as necessary, whereas other WMs just ignore.

As far as I can tell, something in the Matchbox panel is providing this functionality (I loaded it in xfce4 and it worked, but that is far from usable). I have tried running '/usr/bin/lightnpower.py --loadandquit' in various apm scripts, but it either doesn't get called (most suspend commands use 'xset dpms force off' rather than 'apm -s') or it only half works for some strange reason (e.g. will change back lighting but not time to suspend).

Does anyone know how the power monitoring functionality can be added to other window managers?

Thanks

Karl
silencer51
Indeed, in all other WMs (i.e. XFCE4) when you are for example running on battery power and have the backlight set to 1, when you plug in AC power the backlight doesn't automatically go to level 6. You have to manually start the Light & Power applet to make the system understand the change. Bummer...
Chero
I'm running a combo of xfce4(xfdesktop) and fbpanel (instead of xfce4-panel).

The benefit of this is :
- a panel on each screen
- taskbar of running apps
- dropdown menu with all apps (fn+click or menu button)
- shortcuts (e.g. "alt-f" to toggle apps fullscreen = without borders, titles or panels)
- nice themes
- working power management when the battery applet is running in the fbpanel systray

Have fun,
Chero.
karlto
QUOTE(Chero @ Mar 10 2006, 08:42 PM)
- working power management when the battery applet is running in the fbpanel systray


Hi Chero

That sounds like the fix we are all looking for - is the battery applet the part that does the power management? Running this in various different window managers would be a lot simpler and nicer than an entire panel....

Thanks
vimes
QUOTE(Chero @ Mar 10 2006, 08:42 AM)
I'm running a combo of xfce4(xfdesktop) and fbpanel (instead of xfce4-panel).

The benefit of this is :
- a panel on each screen
- taskbar of running apps
- dropdown menu with all apps (fn+click or menu button)
- shortcuts (e.g. "alt-f" to toggle apps fullscreen = without borders, titles or panels)
- nice themes
- working power management when the battery applet is running in the fbpanel systray

Have fun,
Chero.
*


You've confused me now chero... I am using your build with xfce4-panel and have all of the above features except dropdown menu with all apps (which I assume you mean running tasks)... what/where is fbpanel and since the above works with xfce4-panel why bother ?
am I missing something ?
Chero
QUOTE(karlto @ Mar 12 2006, 08:17 PM)
QUOTE(Chero @ Mar 10 2006, 08:42 PM)
- working power management when the battery applet is running in the fbpanel systray


Hi Chero

That sounds like the fix we are all looking for - is the battery applet the part that does the power management? Running this in various different window managers would be a lot simpler and nicer than an entire panel....

Thanks
*



It seems to be the battery applet indeed. Running it in other WM's could solve the problem, if it could run correctly. In my case, it didn't seem to be running as it should. It showed everything correct, even when you plug ac, but the backlight and suspend settings didn't change automatically.
So I tried fbpanel, and added the same battery applet, now it works.

A screenshot can be found here : http://www.oesf.org/forums/index.php?showtopic=18239 (post 3)

Have fun,
Chero.
Chero
QUOTE(vimes @ Mar 14 2006, 09:17 PM)
QUOTE(Chero @ Mar 10 2006, 08:42 AM)
I'm running a combo of xfce4(xfdesktop) and fbpanel (instead of xfce4-panel).

The benefit of this is :
- a panel on each screen
- taskbar of running apps
- dropdown menu with all apps (fn+click or menu button)
- shortcuts (e.g. "alt-f" to toggle apps fullscreen = without borders, titles or panels)
- nice themes
- working power management when the battery applet is running in the fbpanel systray

Have fun,
Chero.
*


You've confused me now chero... I am using your build with xfce4-panel and have all of the above features except dropdown menu with all apps (which I assume you mean running tasks)... what/where is fbpanel and since the above works with xfce4-panel why bother ?
am I missing something ?
*



About power : see previous post.

The drop-down menu with running apps : middle-click (shift-tap)
The drop-down menu with all apps : right-click (fn-tap) If you want to test it : type "xfdesktop -menu" at command prompt.
If you don't get it with fn-tap, your keyboard settings are probably wrong. The original startxfce4 script was written for a C860, it has to be changed for CXXXX.
I'll try to put mine online asap.

Another reason to use a different panel : xfce4-panel likes to crash, fbpanel seems more stable to me.

Where is fbpanel : not packed yet(at least, not by me).

Have fun,
Chero (just had a shower !!) wink.gif
vimes
QUOTE(Chero @ Mar 14 2006, 09:37 PM)
About power : see previous post.

The drop-down menu with running apps : middle-click (shift-tap)
The drop-down menu with all apps : right-click (fn-tap) If you want to test it : type "xfdesktop -menu" at command prompt.
If you don't get it with fn-tap, your keyboard settings are probably wrong. The original startxfce4 script was written for a C860, it has to be changed for CXXXX.
I'll try to put mine online asap.

Another reason to use a different panel : xfce4-panel likes to crash, fbpanel seems more stable to me.

Where is fbpanel : not packed yet(at least, not by me).

Have fun,
Chero (just had a shower !!)  wink.gif
*


5 euro's poorer hey smile.gif

... now I understand - i have menu on both right mouse and menu-key (although yes xfce4-panel doesn't seem to have a tasks menu).
fyi, power functions all work fine for me using mb-applet-battery in xfce4-panel except suspend on lid close which I ain't worked out yet. sad.gif Also, thanks to your kind self I have not had 1 crash of xfce4-panel since I started using it about 3 weeks ago.

Thanks for a lovely zaurus desktop smile.gif
Chero
QUOTE(vimes @ Mar 14 2006, 09:50 PM)
5 euro's poorer hey smile.gif

... now I understand - i have menu on both right mouse and menu-key (although yes xfce4-panel doesn't seem to have a tasks menu).
fyi, power functions all work fine for me using mb-applet-battery in xfce4-panel except suspend on lid close which I ain't worked out yet. sad.gif Also, thanks to your kind self I have not had 1 crash of xfce4-panel since I started using it about 3 weeks ago.

Thanks for a lovely zaurus desktop smile.gif
*


Just 2,5 euro's, it was a quick shower.

Maybe the next version will be more compatible. I think it would at least solve some problems when changing to 4.2.3.2. I'll do it anyway to be able to compile the new thunar-release (though I'm waiting for the first beta, which will be released real soon). I'd better start working on xfce and be ready for thunar beta1.

Chero.
vimes
Chero, while I'm on about xfce4-panel, can you tell me how I can fix/configure stuff in the
--- include --- system
menu entry in xfce4-menu's ? It works fine except games & system settings get mixed up (oh and no icon on 'other' submenu) - see screenshot
Click to view attachment

Thanks smile.gif
karlto
QUOTE(Chero @ Mar 15 2006, 09:26 AM)
QUOTE(karlto @ Mar 12 2006, 08:17 PM)
QUOTE(Chero @ Mar 10 2006, 08:42 PM)
- working power management when the battery applet is running in the fbpanel systray


Hi Chero

That sounds like the fix we are all looking for - is the battery applet the part that does the power management? Running this in various different window managers would be a lot simpler and nicer than an entire panel....

Thanks
*



It seems to be the battery applet indeed. Running it in other WM's could solve the problem, if it could run correctly. In my case, it didn't seem to be running as it should. It showed everything correct, even when you plug ac, but the backlight and suspend settings didn't change automatically.
So I tried fbpanel, and added the same battery applet, now it works.

A screenshot can be found here : http://www.oesf.org/forums/index.php?showtopic=18239 (post 3)

Have fun,
Chero.
*



I didn't realise you were talking about the matchbox applet - doesn't seem to work in the xfce4 panel, which is why I went to trying the whole matchbox panel. Must be some sort of combination if fbpanel does work...?

On a side note, the matchbox panel is much less cumbersome under enlightenment, because it minimises... :-\
miskinis
Hi,

I consider correct power management a high priority for any battery-operated device
I own, especially a handheld computer I will rely on away from wired power sources.

SO, I'm somewhat willing to try to help out pdaXrom in this regard. From what I gather
so far, it seems the "stock/default" pdaXrom using the matchbox project applets, does
accomplish this very well, but folks are having difficulty getting the applets to run
in other window managers.

This is most likely due to the fact that the applets differ somewhat from standard X
clients. And if this is true, I suspect that the "meat and potatoes" code inside the
applet, could be wrapped up into a standard X client, thus being able to be run
under any window manager. (I could probably do this easily)

Unfortunately, the one piece I do not know about, is how the power-on button press
is detected, and what happens. When the machine is running, I suspect that a
regular X event for a key press is generated, and intercepted by the WM and passed
on to the (correct) applet.

BUT, what happens when the machine is already suspended, and the power-on
button is pressed? Something else must happen, and I would need to know what.

If anyone knows these details, or knows that any of my suspicions above are incorrect,
please post!

Thanks, John
karlto
QUOTE(miskinis @ Mar 15 2006, 07:05 PM)
Hi,

I consider correct power management a high priority for any battery-operated device
I own, especially a handheld computer I will rely on away from wired power sources.

SO, I'm somewhat willing to try to help out pdaXrom in this regard.  From what I gather
so far, it seems the "stock/default" pdaXrom using the matchbox project applets, does
accomplish this very well, but folks are having difficulty getting the applets to run
in other window managers.

This is most likely due to the fact that the applets differ somewhat from standard X
clients.  And if this is true, I suspect that the "meat and potatoes" code inside the
applet, could be wrapped up into a standard X client, thus being able to be run
under any window manager.  (I could probably do this easily)

Unfortunately, the one piece I do not know about, is how the power-on button press
is detected, and what happens.  When the machine is running, I suspect that a
regular X event for a key press is generated, and intercepted by the WM and passed
on to the (correct) applet.

BUT, what happens when the machine is already suspended, and the power-on
button is pressed?  Something else must happen, and I would need to know what.

If anyone knows these details, or knows that any of my suspicions above are incorrect,
please post!

Thanks,  John
*


As I understand it, this power management is a core feature of the pxa processor. When put to sleep/suspended, registers are set determining what will wake the machine up, and everything but the RTC and some sort of edge-detect mechanism is turned off. Obviously the power button being held is one of the wakeup events, as is the RTC alarm once set and switched on. All these suspend items are set when the device is put to sleep, and is part of the kernel code.

I tried running xev to capture the power button, but didn't get anything (aside from switching the power on and off if I hold it down!) Regardless, this aspect works fine in any window manager.

The only issue really is switching between battery and AC power. All battery monitors seem to detect the change, but we need to run a script (probably just '/usr/bin/lightnpower.py --loadandquit') each time this happens to change the power settings to suit. There is currently no way to do this.

It also needs to happen upon resume, just in case it has changed modes while asleep. It is possible to add scripts in this instance, which I have tried to do. Initially it failed completely. Having a 'sleep' command in the script for a few seconds prior to running the lightnpower applet caused the backlight settings to be changed successfully, but I never managed to get the suspend timeout settings to change.

I don't think this is specifically related to X in any way - if X is not running, there is no power management at the command line either. I need to try out the battery applet on its own (without the matchbox panel) again in xfce and enlightenment to find out if it does monitor this correctly.

The other thought I had was to perhaps find (or modify) a battery applet that will allow running a command when power mode changes. Then it could just be scripted.

Everyone please feel free to correct the likely numerous inaccuracies above smile.gif
miskinis
That was great info, thanks...

I forgot to ask about the battery charging light. It seems that when I have power
connected to the SL-6000, when suspended at least, the battery charging light is
always on. If I remember correctly, and it's been quite a while, but I think when I
got my unit and it was running the Sharp ROM, the battery light would go off
when the battery was fully charged.

Is there a reason why this does not function on pdaXrom? Is this true for all
the Zaurus models?

Thanks again for any info, John
vimes
QUOTE(miskinis @ Mar 17 2006, 07:18 AM)
That was great info, thanks...

I forgot to ask about the battery charging light.  It seems that when I have power
connected to the SL-6000, when suspended at least, the battery charging light is
always on.  If I remember correctly, and it's been quite a while, but I think when I
got my unit and it was running  the Sharp ROM, the battery light would go off
when the battery was fully charged.

Is there a reason why this does not function on pdaXrom?  Is this true for all
the Zaurus models?

Thanks again for any info,  John
*


The light goes off on my C3000 when battery is full...
Also you can run mb-applet-battery in xfce4 and e17 - you just need the appropriate systray plugin running.
miskinis
QUOTE(vimes @ Mar 17 2006, 10:41 AM)
The light goes off on my C3000 when battery is full...
Also you can run mb-applet-battery in xfce4 and e17 - you just need the appropriate systray plugin running.


Hi,

I reverted back to running the default openbox WM and matchbox components a
day or so ago, for reasons outside the scope of this post.

I see the mb-applet-battery process running. In fact I just turned on the 6000 to
make sure, and when I did, I noticed the battery meter go from about 75% to 100%
like it was "catching up" to the correct value after being resumed.

Q: How could the mb-applet-battery process affect (control) the charging light
while the Z is suspended?
vimes
QUOTE(miskinis @ Mar 17 2006, 12:36 PM)
Hi,

I reverted back to running the default openbox WM and matchbox components a
day or so ago, for reasons outside the scope of this post.

I see the mb-applet-battery process running.  In fact I just turned on the 6000 to
make sure, and when I did, I noticed the battery meter go from about 75% to 100%
like it was "catching up" to the correct value after being resumed.

Q: How could the mb-applet-battery process affect (control)  the charging light
        while the Z is suspended?
*



sorry I wasn't too clear - I'm not suggesting that mb-applet-battery has anything to do with the charging light - simply providing some feedback to this query.
QUOTE
Is there a reason why this does not function on pdaXrom? Is this true for all
the Zaurus models?
silencer51
QUOTE(vimes @ Mar 17 2006, 12:41 PM)
The light goes off on my C3000 when battery is full...
Also you can run mb-applet-battery in xfce4 and e17 - you just need the appropriate systray plugin running.
*


Hey, could you please elaborate on that? Having the mb-applet-battery in xfce4 would be great! smile.gif
vimes
QUOTE(silencer51 @ Mar 17 2006, 12:52 PM)
QUOTE(vimes @ Mar 17 2006, 12:41 PM)
The light goes off on my C3000 when battery is full...
Also you can run mb-applet-battery in xfce4 and e17 - you just need the appropriate systray plugin running.
*


Hey, could you please elaborate on that? Having the mb-applet-battery in xfce4 would be great! smile.gif
*



just load xfce4 systemtray into your panel and then run mb-applet-whateveryouwant ... they then appear in your panel... busy in work so no time for a lengthier response just now... same principal in e17 - run the systemtray plugin (not sure of exact name from memory... itasks maybe ?) and then run your mb-applets
have a look at screenshot in this post
good luck
silencer51
When I try to add the system tray plugin into the panel, i get a "could not create panel item "Systemtray"... :-( Any ideas?
silencer51
Update: I got it, I just had to follow cmpayc's advice on the "kde works; what about gnome" thread... :-)

Just a couple more questions: I have the systray plugin running ok and I have added the applets I want to it.

Is there any way to change the icons? Apart from looking, well, a little distorted, I think, they also have no transparency, meaning my desktop looks like this:



On

If there is any way to sort this out, say, like in the following screenshot:

http://www.oesf.org/forums/index.php?act=A...pe=post&id=2074

cool.gif
miskinis
QUOTE(silencer51 @ Mar 18 2006, 05:37 AM)
s there any way to change the icons? Apart from looking, well, a little distorted, I think, they also have no transparency, meaning my desktop looks like this:


1 - That screen looks really nice. It's posts like that attracts new folks, expanding the
user base! smile.gif

2 - Those icons appear to be designed with a specific a background color of the surrounding
area in mind. If you compare both screenshots side by side, you will notice that the
background color of the XFCE panel is lighter in the one you referenced in the link.
This makes the icons appear almost transparent, but if you take a close look, on a big
monitor if necessary, you see that the background color of the icons are slightly darker
than the panel.

OR - They are transparent, but they are overlayed onto an incorrect "sub area"
background color.

John
ma401
QUOTE(miskinis @ Mar 17 2006, 11:16 PM)
2 -  Those icons appear to be designed with a specific a background color of the surrounding
      area in mind.


I think that's the one. I find it's easier to just pick a lighter theme that blends better (you can see the outlines in the screenshot but it's pretty much impossible to tell apart on the screen itself).

Click to view attachment
silencer51
Wow ma40, that's a great desktop! :-)

Which theme is that?
ma401
QUOTE(silencer51 @ Mar 18 2006, 05:05 AM)
Wow ma40, that's a great desktop! :-)

Which theme is that?
*


Xfce-basic with the Wildbrush style, customized a touch ;p
karlto
@miskinis: my SL6000 occasionally turns the charging light off when battery is full, but not very often. I imagine its possible that this is also related to the power management thing, but I haven't investigated because it doesn't bother me.

@silencer51: does having the mb battery applet loaded in xfce4 give you working power management? It didn't work for me when I tried it, but Chero has reported success using it with fbpanel in xfce4.

(edit):
Loading the mb-applet-battery in enlightenment does give me working power management! It shows in the itray module.

(edit #2):
The charge light does switch off with the battery applet running...
silencer51
Yeah, power management works for me using xfce4 panel...
jerrybme
xfce4 panel with systray & mb-applet-battery loaded power management works for me too

Cheers
cmpayc13
Hi Chero,

could You please post Your fbpanel-config.

I think about (I'm going to use) fvwm with fbpanel.

Thanks a lot in advance

Best regards

Cmpayc
miskinis
A couple days ago I setup XFCE and the mb-applet-battery as well on the SL-6000.
I turned it on today, and I was pleased to see it just as I had left it, with an xterm running,
and no WM restart occurred.

Battery level was 100% according to the apm command. I plugged in the AC power
(through the cradle, just in case this another variable) and notice something which
suprises me:

# cat /proc/apm
1.14 1.2 0x02 0x01 0x03 0x08 255% -1 ?

Maybe this "255%" is "normal", but I think I'll post it, to check with others. Perhaps
there is some alignment/interpretation issues between some SW and HW? I keep
seeing the same output, and the charging light remains on for now.

John
Da_Blitz
For those running pdaXrom without X wink.gif setfl and apm are all the power managment i need

setfl changes brightness, just add 0 to 6 after it and apm is the on/off, i would like auto off on inactivity however i have walked away from my zaurus in text mode and come back 8 hours latter and it was still going, i still have no idea why it didnt run out of battery

for people using screen i would recomend you have a look at www.grml.org, its a live CD thats text bassed but well set up, thier zsh and screen configs are the best, just 'liberate' the screen config file as it has apm support in it (bar at the bottom changes color, there zsh scripts do as well with the prompt changing color with remaining power

i use twin as my window manager: http://linuz.sns.it/~max/twin/index.shtml get the ipkg here http://mail.pdaxrom.org/contrib/dtruchan/
miskinis
Wow, my SL-6000 charging light just went off! And, then I just took
it out of the cradle and put it back to make sure it was not the LED or
the power supply, and it went on for a minute or so, and back off! smile.gif
karlto
QUOTE(miskinis @ Mar 21 2006, 11:56 PM)
Wow, my SL-6000 charging light just went off!  And, then I just took
it out of the cradle and put it back to make sure it was not the LED or
the power supply, and it went on for a minute or so, and back off! smile.gif
*


Cool - in reply to your earlier post, I currently have my SL6000 in the cradle with battery fully charged (light is off), and /proc/apm only shows 100%. I am still running RC12 though. I did notice while running the enlightenment battery applet that it had some strange numbers shown that were constantly changing.
Dobby
I've just read this thread and I'm a little confused as to what people managed to get working. I'm using Xfce 4.4 beta 2 and would like to get power management working (removing ac changes power settings). Is this possible? It doesn't seem to be working at the moment.
karlto
QUOTE(Dobby @ Sep 12 2006, 11:16 AM)
I've just read this thread and I'm a little confused as to what people managed to get working. I'm using Xfce 4.4 beta 2 and would like to get power management working (removing ac changes power settings). Is this possible? It doesn't seem to be working at the moment.
*

All you need to do is run the matchbox battery monitor applet - it will take care of this. I believe it needs some sort of panel to run in (I'm using fbpanel), but I presume it will also work with the xfce panel.
pelrun
All the matchbox battery applet does is check apm every two seconds, and if the ac state changes it invokes "lightnpower.py --loadandquit". A small script could probably do the same thing pretty easily if you don't want to (or can't) run the applet.
desertrat
QUOTE(pelrun @ Sep 12 2006, 03:53 AM)
All the matchbox battery applet does is check apm every two seconds, and if the ac state changes it invokes "lightnpower.py --loadandquit". A small script could probably do the same thing pretty easily if you don't want to (or can't) run the applet.

Might be less hassle to just run a cron job every minute to execute "lightnpower.py --loadandquit".

Edit: but lightnpower.py might be resource heavy to load, so maybe write a script that does the equivalent of the battery applet (ie check power status then run lightnpower.py accordingly) smile.gif
Dobby
Yea I like the cron job idea I think that would work ok. Especially as I like the xfce battery icon better.
Dobby
How can I check the status cause I think you're right desertrat it does take some time to load. Although Zumi is busy rewriting the py apps so maybe this will help.
desertrat
QUOTE(Dobby @ Sep 12 2006, 08:40 AM)
How can I check the status

No idea, have a look at the battery applet, if it's written in python then dissect it.

QUOTE
cause I think you're right desertrat it does take some time to load.

As lightnpower.py is a python program it should be possible to examine and just lift out the parts which does the apm and stick it into a shell script. It's the loading of the gui that takes a long time.

QUOTE
Although Zumi is busy rewriting the py apps so maybe this will help.

The rewritten apps are ready for beta testing, see main pdaXrom site for announcement.
Dobby
All good points smile.gif

It's just the date & time app so far. I've tested it out and it's looking good.
karlto
@pelrun: thanks for the info - if I'd known this back when I started the thread it would've saved some time! (the battery applet is compiled, not a python script so there is no dissecting as I couldn't even find the source)

@Dobby: I imagine such a script would go something like this:

CODE
#!/bin/sh

if [ ! -f ~/.apm_store ]; then
 lightnpower.py --loadandquit
 cat /proc/apm > ~/.apm_store
else
 $CUR = $(cat /proc/apm)
 $OLD = $(cat ~/.apm_store)
 if [ ! "$OLD" = "$CUR" ]; then
   lightnpower.py --loadandquit
   cat /proc/apm > ~/.apm_store
 fi
fi


(and you could run it every so often with atd)
Dobby
cool! Thanks for that karlto. Finally starting to get a usable device!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.