OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: karlto on March 09, 2006, 02:42:22 pm

Title: Power Management
Post by: karlto on March 09, 2006, 02:42:22 pm
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
Title: Power Management
Post by: silencer51 on March 09, 2006, 11:01:12 pm
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...
Title: Power Management
Post by: Chero on March 10, 2006, 02:42:06 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.
Title: Power Management
Post by: karlto on March 12, 2006, 02:17:36 pm
Quote
- 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
Title: Power Management
Post by: vimes on March 14, 2006, 03:17:37 pm
Quote
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.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=117868\"][{POST_SNAPBACK}][/a][/div]

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 ?
Title: Power Management
Post by: Chero on March 14, 2006, 03:26:28 pm
Quote
Quote
- 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
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]
 (http://index.php?act=findpost&pid=118200\")

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 : [a href=\"https://www.oesf.org/forums/index.php?showtopic=18239]https://www.oesf.org/forums/index.php?showtopic=18239[/url] (post 3)

Have fun,
Chero.
Title: Power Management
Post by: Chero on March 14, 2006, 03:37:31 pm
Quote
Quote
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.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=117868\"][{POST_SNAPBACK}][/a][/div]

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 ?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118564\"][{POST_SNAPBACK}][/a][/div]

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 !!)  
Title: Power Management
Post by: vimes on March 14, 2006, 03:50:28 pm
Quote
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 !!) 
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118567\"][{POST_SNAPBACK}][/a][/div]

5 euro's poorer hey

... 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.  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
Title: Power Management
Post by: Chero on March 14, 2006, 04:02:15 pm
Quote
5 euro's poorer hey

... 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.  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
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118570\"][{POST_SNAPBACK}][/a][/div]

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.
Title: Power Management
Post by: vimes on March 14, 2006, 06:57:53 pm
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
 [ You are not allowed to view attachments ]

Thanks
Title: Power Management
Post by: karlto on March 14, 2006, 11:29:42 pm
Quote
Quote
Quote
- 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
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]
 (http://index.php?act=findpost&pid=118200\")

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 : [a href=\"https://www.oesf.org/forums/index.php?showtopic=18239]https://www.oesf.org/forums/index.php?showtopic=18239[/url] (post 3)

Have fun,
Chero.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118565\"][{POST_SNAPBACK}][/a][/div]

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... :-\
Title: Power Management
Post by: miskinis on March 15, 2006, 01:05:05 am
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
Title: Power Management
Post by: karlto on March 15, 2006, 02:26:19 pm
Quote
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
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118630\"][{POST_SNAPBACK}][/a][/div]

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
Title: Power Management
Post by: miskinis on March 17, 2006, 02:18:02 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
Title: Power Management
Post by: vimes on March 17, 2006, 05:41:11 am
Quote
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
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118976\"][{POST_SNAPBACK}][/a][/div]

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.
Title: Power Management
Post by: miskinis on March 17, 2006, 07:36:20 am
Quote
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?
Title: Power Management
Post by: vimes on March 17, 2006, 07:46:29 am
Quote
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?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118999\"][{POST_SNAPBACK}][/a][/div]


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?
Title: Power Management
Post by: silencer51 on March 17, 2006, 07:52:45 am
Quote
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.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118990\"][{POST_SNAPBACK}][/a][/div]

Hey, could you please elaborate on that? Having the mb-applet-battery in xfce4 would be great!
Title: Power Management
Post by: vimes on March 17, 2006, 11:01:39 am
Quote
Quote
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.
[div align=\"right\"][{POST_SNAPBACK}][/a][/div] (http://index.php?act=findpost&pid=118990\")

Hey, could you please elaborate on that? Having the mb-applet-battery in xfce4 would be great!
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119004\"][{POST_SNAPBACK}][/a][/div]

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 [a href=\"https://www.oesf.org/forums/index.php?showtopic=18138&view=findpost&p=118596]this post[/url]
good luck
Title: Power Management
Post by: silencer51 on March 18, 2006, 12:02:09 am
When I try to add the system tray plugin into the panel, i get a "could not create panel item "Systemtray"... :-( Any ideas?
Title: Power Management
Post by: silencer51 on March 18, 2006, 12:37:49 am
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:

Title: Power Management
Post by: miskinis on March 18, 2006, 01:16:26 am
Quote
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!  

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
Title: Power Management
Post by: ma401 on March 18, 2006, 05:51:19 am
Quote
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).

 [ You are not allowed to view attachments ]
Title: Power Management
Post by: silencer51 on March 18, 2006, 07:05:12 am
Wow ma40, that's a great desktop! :-)

Which theme is that?
Title: Power Management
Post by: ma401 on March 18, 2006, 01:52:41 pm
Quote
Wow ma40, that's a great desktop! :-)

Which theme is that?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119121\"][{POST_SNAPBACK}][/a][/div]

Xfce-basic with the Wildbrush style, customized a touch ;p
Title: Power Management
Post by: karlto on March 19, 2006, 03:07:35 pm
@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...
Title: Power Management
Post by: silencer51 on March 20, 2006, 03:50:20 am
Yeah, power management works for me using xfce4 panel...
Title: Power Management
Post by: jerrybme on March 20, 2006, 01:26:54 pm
xfce4 panel with systray & mb-applet-battery loaded power management works for me too

Cheers
Title: Power Management
Post by: cmpayc13 on March 20, 2006, 04:02:26 pm
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
Title: Power Management
Post by: miskinis on March 20, 2006, 11:19:30 pm
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
Title: Power Management
Post by: Da_Blitz on March 21, 2006, 05:17:24 am
For those running pdaXrom without X  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 (http://linuz.sns.it/~max/twin/index.shtml) get the ipkg here http://mail.pdaxrom.org/contrib/dtruchan/ (http://mail.pdaxrom.org/contrib/dtruchan/)
Title: Power Management
Post by: miskinis on March 21, 2006, 05:56:25 am
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!
Title: Power Management
Post by: karlto on March 21, 2006, 02:42:36 pm
Quote
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!
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119558\"][{POST_SNAPBACK}][/a][/div]

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.
Title: Power Management
Post by: Dobby on September 11, 2006, 06:16:24 pm
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.
Title: Power Management
Post by: karlto on September 11, 2006, 10:59:00 pm
Quote
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.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=141160\"][{POST_SNAPBACK}][/a][/div]
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.
Title: Power Management
Post by: pelrun on September 11, 2006, 11:53:52 pm
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.
Title: Power Management
Post by: desertrat on September 12, 2006, 01:02:56 am
Quote
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)
Title: Power Management
Post by: Dobby on September 12, 2006, 04:32:21 am
Yea I like the cron job idea I think that would work ok. Especially as I like the xfce battery icon better.
Title: Power Management
Post by: Dobby on September 12, 2006, 04:40:25 am
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.
Title: Power Management
Post by: desertrat on September 12, 2006, 04:51:40 am
Quote
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.
Title: Power Management
Post by: Dobby on September 12, 2006, 04:56:29 am
All good points

It's just the date & time app so far. I've tested it out and it's looking good.
Title: Power Management
Post by: karlto on September 12, 2006, 11:10:23 pm
@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: [Select]
#!/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)
Title: Power Management
Post by: Dobby on September 13, 2006, 04:15:24 am
cool! Thanks for that karlto. Finally starting to get a usable device!