Notices


Reply
Thread Tools
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#41
Originally Posted by austin View Post
...I don't know how you can really simplify the config language from something like "key_up = exec osso-xterm" which seems about as simple as you can get for this operation...
This is what I want to do. I want to execute non-dbus apps and shell scripts with hardware keys. However, I can't figure out from your example config files how you actually do this. Can you expand upon the "key_up = exec osso-xterm" example you gave above?

Let's say I want to execute a script, "/usr/bin/script1" by hitting the middle button on the d-pad ("key_press_select"?), and I want to execute another script, "/sbin/script2 -g param1 -k param2 param3" when I hit the fullscreen button ("key_press_fullscreen"?). How would I do this? Which config file would I modify? Is there a way to put these commands into a separate .conf file?

Thanks in advance...
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!

Last edited by qole; 2008-07-27 at 23:18.
 
Posts: 34 | Thanked: 21 times | Joined on Feb 2008
#42
Originally Posted by qole View Post
This is what I want to do. I want to execute non-dbus apps and shell scripts with hardware keys. However, I can't figure out from your example config files how you actually do this. Can you expand upon the "key_up = exec osso-xterm" example you gave above?

Let's say I want to execute a script, "/usr/bin/script1" by hitting the middle button on the d-pad ("key_press_select"?), and I want to execute another script, "/sbin/script2 -g param1 -k param2 param3" when I hit the fullscreen button ("key_press_fullscreen"?). How would I do this? Which config file would I modify? Is there a way to put these commands into a separate .conf file?
create a new file /home/user/.powerlaunch/powerlaunch.conf
Code:
[main]
on_init = call common.init.main; inherit systemui.ui; call systemui.ui.layout; call mce.init.main
key_select = exec "/usr/bin/script1"
key_fullscreen = exec "/sbin/script2 -g param1 -k param2 param3"
You don't need to directly use key_press_* so just use key_* unless you need to do something fancy. You can put it into a separate file and load it from powerlaunch.conf but it's probably easier to just override the default with the above. Everything in the default powerlaunch.conf (except the first main.on_init) is pretty much just examples.
 

The Following User Says Thank You to austin For This Useful Post:
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#43
Sorry, that doesn't work. Nothing has changed in the behaviour of those two buttons, in any context. I know powerlaunch is running, because I changed the "Are you sure" prompts for reboot and shutdown in the .conf files and they have changed...

Perhaps I need to define a "mode" or something? I want the default behaviours for those buttons to change in almost all contexts.
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!
 
Posts: 34 | Thanked: 21 times | Joined on Feb 2008
#44
To be clear, as I'm not sure what you mean by almost all contexts, if you make the changes above, you should be able to hit the power button (system menu will pop up) and then your new keys should work. You also have to restart powerlaunch if you make changes to the config file. Easiest thing to do is stop powerlaunch and then run it from the command line and you'll get debugging info.
 

The Following User Says Thank You to austin For This Useful Post:
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#45
I now understand. Sometimes I can be pretty thick! Of course, "powerlaunch" is triggered by pressing the power key. I somehow stupidly thought I could use it to remap keys throughout the UI.
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#46
Thank-you Austin, I got it working for my purposes. Here is my powerlaunch.conf file:

Code:
[main]
on_init = call common.init.main; inherit systemui.ui; call systemui.ui.layout; call mce.init.main
key_menu = hide; banner "wait..."; exec "/usr/bin/mbk"; banner "keyboard toggle"
key_fullscreen = hide; banner "wait..."; exec "sudo /sbin/debian wmctrl -r :ACTIVE: -b toggle,fullscreen"; banner "fullscreen toggle"
This makes the power-fullscreen key combo toggle any app to fullscreen (using Debian wmctrl), and the power-menu key combo toggle the matchbox-keyboard (using the mbk script that kills the keyboard if it is running or starts it if it isn't running).

I use the "wait..." banner just in case it takes a minute to fire up the chroot environment (it never has taken long on my system), and I use the post-execution banner to announce that something has (or should have) happened.

Just a question: You have the following example line in your config:
Code:
key_left = call common.powerlaunch.reload; banner "Powerlaunch reloaded"
This announces that powerlaunch has reloaded, but changes in my config file do not take effect.
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!

Last edited by qole; 2008-07-29 at 03:25.
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#47
austin: Please try to find some time to address the issue of broken alarms in powerlaunch. As your package starts to become more widely used (due to my recommendation via Easy Debian), other people are complaining about it and it is such a great solution ... except for the alarms issue...
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!
 
Posts: 34 | Thanked: 21 times | Joined on Feb 2008
#48
Thanks for reminding me about the alarms. I've figured out how to use powerlaunch to catch the alarms given off from the builtin alarmd. It's mainly now a matter of getting powerlaunch to respond in an appropriate manner. I'll try to get something out with working alarms soon.
 

The Following 4 Users Say Thank You to austin For This Useful Post:
Posts: 34 | Thanked: 21 times | Joined on Feb 2008
#49
Alarms should be working in powerlaunch 0.9 and it's now installable from the maemo extras-devel repository
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#50
The other problem was the loss of the flashing LCD when an e-mail arrived. Is this addressed in the alarm fix?

Currently, I have devised a workaround using xbindkeys that allows commands to be executed by pressing the "-" key followed by another HW key.
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!
 
Reply


 
Forum Jump


All times are GMT. The time now is 11:59.