Active Topics

 



Notices


Reply
Thread Tools
Posts: 34 | Thanked: 21 times | Joined on Feb 2008
#31
Ah. The problem is the priority order of handlers. In common.init, the two default_inherit actions should be moved to the front of the list before all the calls. Then when n810.conf is loaded, it will have higher priority. That eliminates the need for doing the if checks in common.conf. To get rid of the variable initialization bug, add to the n810.init.main as the last action, "if $hal{/org/freedesktop/Hal/devices/platform_slide:button.state.value} keyboard_slide_close keyboard_slide_open" That should fix initialization
 

The Following User Says Thank You to austin For This Useful Post:
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#32
Yes, this fixes both issues, thanks. As for priority change, should I now call common.defaut.display_x handlers from n810 display_x ones? I guess in theory I should.

BTW, the language is a bit limiting, logical operators or subexpressions in 'if' would be nice or nested if-s like if something1 if something2 handler1. Also command blocks {} could be handy in that case (of nested ifs). But true that such issues can be solved by defining more intermediate handlers and chaining them.
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.
 
Posts: 34 | Thanked: 21 times | Joined on Feb 2008
#33
No, don't call common.default.display_... from n810. The point was to override them. But now that I think about it, I might change the overloading handler code in powerlaunch. Instead of only executing the one handler, it could just execute all, unless a special action is called to stop execution. I'll have to think about which case (overriding or chaining) is more common.

About the language, that's kind of funny given how this thread started...In fact, i purposely tried to simplify the core language as much as possible. I didn't want a full language so nested ifs and command blocks will likely never be implemented as it can be implemented in other ways. Logical expressions are likely to be implemented as I'm thinking of moving all of expr into powerlaunch. Note that you should be able to use expr to do logical expressions currently like if `expr $foo | $bar` ...
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#34
Originally Posted by austin View Post
But now that I think about it, I might change the overloading handler code in powerlaunch. Instead of only executing the one handler, it could just execute all, unless a special action is called to stop execution. I'll have to think about which case (overriding or chaining) is more common.
I'd vote for current way. Calling it explicitly when it makes sense is easier to understand IMO. It also allows you to call common code before or after your specific one. Or maybe some keyword like 'call super' would be nice so you don't need to know where is parent code.

Originally Posted by austin View Post
About the language, that's kind of funny given how this thread started...In fact, i purposely tried to simplify the core language as much as possible. I didn't want a full language so nested ifs and command blocks will likely never be implemented as it can be implemented in other ways.
Yes, I agree, even if 'other ways' produces spaghetti code which is less straightforward for newbie powerlaunch programmers. Took me a while to figure out how to do basic stuff. But still, cleaner and smaller language is good too.

Originally Posted by austin View Post
Logical expressions are likely to be implemented as I'm thinking of moving all of expr into powerlaunch.
Great. I was thinking about moving 'reading of light sensor lux value and comparing it' into powerlaunch directly but did not know how to implement 'less than five'. And then also found that the sensor is not exported via hal (at least lshal output does not ring a bell with me) so I need filesystem access anyway.

Also negation is quite useful for 'if' if you just need 'else' clause.
Originally Posted by austin View Post
Note that you should be able to use expr to do logical expressions currently like if `expr $foo | $bar` ...
Ah, I see. Will try.
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.
 
Posts: 566 | Thanked: 150 times | Joined on Dec 2007
#35
I too only use powerlaunch for softpoweroff, so I'm happy that mce.conf can now be used to map it to the powerkey in a simple way. I do miss a way to force the wifi to turn off when going into softpoweroff in order to save power. I know mce.conf does not implement this, only 'off line mode' but that requires to manually take it out of 'off line mode' again, which is not what I want. So I guess I'll still have to figure out how use powerlaunch.conf. Or does softpoweroff mean that all processes including wi-fi are suspended?

Last edited by iamthewalrus; 2008-07-12 at 14:59.
 
Posts: 34 | Thanked: 21 times | Joined on Feb 2008
#36
Originally Posted by iamthewalrus View Post
I do miss a way to force the wifi to turn off when going into softpoweroff in order to save power. I know mce.conf does not implement this, only 'off line mode' but that requires to manually take it out of 'off line mode' again, which is not what I want. So I guess I'll still have to figure out how use powerlaunch.conf. Or does softpoweroff mean that all processes including wi-fi are suspended?
softpoweroff doesn't really do anything other than lock keys and turn off screen. I think this will do what you want. In /etc/powerlaunch/system.conf, under the [device] section, edit the following two lines:
Code:
softpoweroff = dbus_call powered SoftPowerOff; set in_softpoweroff 1; call system.device.offline_mode
softpoweron = dbus_call powered SoftPowerOn; set in_softpoweroff 0; call system.device.normal_mode
The changes are the two extra calls at the end to switch to offline or normal mode on softpoweroff/on
 

The Following User Says Thank You to austin For This Useful Post:
Posts: 566 | Thanked: 150 times | Joined on Dec 2007
#37
Now I have run into another issue. It seems that powerlaunch makes the alarms of maemo clock (utils->clock, alarm->set alarm) stop working. It is reproducible with Diablo, I haven't tested it with chinook.

Last edited by iamthewalrus; 2008-07-14 at 16:58.
 
Posts: 34 | Thanked: 21 times | Joined on Feb 2008
#38
Yes alarms don't work. It is a known problem and I have not had time to figure out the issue.
 
icebox's Avatar
Posts: 282 | Thanked: 120 times | Joined on Nov 2007
#39
Hmmm, I tried powerlaunch a few months before for it's nicely advertised capability of configuring the tablet to lock the screen but not the keys. (It's nice to be able to increase volume in your pocket without taking the tablet out - unlocking - turn up sound - lock - put back). Figuring slackware in '98 when I decided I want to learn *nix took me far less...

I followed this thread and things seem to clear *a bit*. So is the function above possible? thanks.
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#40
"The function above"; you mean locking the screen, but not keys? It's in the sample config files.
 
Reply


 
Forum Jump


All times are GMT. The time now is 03:09.