Siglaunchd

From Openmoko

(Difference between revisions)
Jump to: navigation, search
Line 6: Line 6:
 
For example, one can set the aux button to launch the dialer and the other can set a sound when screen is dimmed with as little as no effort.
 
For example, one can set the aux button to launch the dialer and the other can set a sound when screen is dimmed with as little as no effort.
  
(The default config file is set so open moko terminal will be run when the aux button is pressed for two or more seconds)
+
(The default config file is set to run the porfile-changer when the aux button is pressed for more than a second)
  
 
= Package =
 
= Package =
 
* author: Tom Hacohen <available_at_profile>
 
* author: Tom Hacohen <available_at_profile>
 
* this is a python script so code resides in /usr/bin/siglaunchd (hopefuly in a public svn soon)
 
* this is a python script so code resides in /usr/bin/siglaunchd (hopefuly in a public svn soon)
* link: [http://stosb.com/openmoko/siglaunchd_0.1.2_armv4t.ipk package]
+
* link: [http://stosb.com/openmoko/siglaunchd_0.1.3_armv4t.ipk package]
  
 
== How To Use ==
 
== How To Use ==
Line 33: Line 33:
  
 
I used this configuration to run the openmoko-terminal2 everytime I
 
I used this configuration to run the openmoko-terminal2 everytime I
held the aux button for more than 2 seconds.
+
held the aux button for 2 seconds or more.
  
 
You can actually add as many lines you want to the config and associate as many
 
You can actually add as many lines you want to the config and associate as many
Line 43: Line 43:
  
 
Please send me feedback about bugs/suggestions. Enjoy.
 
Please send me feedback about bugs/suggestions. Enjoy.
 
+
== Change Log ==
 +
'''0.1.3:'''
 +
* added a scripts dir in /usr/share/siglaunchd/scripts/ that's the proper place to put custom user scripts (and stock example ones)
 +
* wrote the profile-changer app, a script packed with the siglaunchd that controls the framework's phone profile using a gui.
 
== TODO ==
 
== TODO ==
 
* upgrade the rules system (add more complex variable types for comparison in the rules)
 
* upgrade the rules system (add more complex variable types for comparison in the rules)
Line 54: Line 57:
 
== List of users configs ==
 
== List of users configs ==
 
This is a list of config lines users added. If you use any custom config yourself (you should, the stock config is a demo) please add it here so others may use them as well.
 
This is a list of config lines users added. If you use any custom config yourself (you should, the stock config is a demo) please add it here so others may use them as well.
=== AUX button - Launch Terminal (stock) ===
+
=== AUX button - Launch The profile-changer (STOCK) ===
 +
"DISPLAY=:0.0 /usr/share/siglaunchd/scripts/profile-changer"=org.freesmartphone.Device.Input;org.freesmartphone.oeventsd;/org/freesmartphone/Device/Input;Event;0=AUX,1=released,2>0
 +
=== AUX button - Launch Terminal ===
 
"DISPLAY=:0.0 openmoko-terminal2"=org.freesmartphone.Device.Input;org.freesmartphone.oeventsd;/org/freesmartphone/Device/Input;Event;0=AUX,1=released,2>1
 
"DISPLAY=:0.0 openmoko-terminal2"=org.freesmartphone.Device.Input;org.freesmartphone.oeventsd;/org/freesmartphone/Device/Input;Event;0=AUX,1=released,2>1
  
 
[[Category:Applications]]
 
[[Category:Applications]]

Revision as of 15:49, 18 November 2008


This project is daemon which listens to dbus signals and runs applications accordingly. The signals, application to run and some rules that will be evaluated against incoming dbus signals can be easily changed in the configuration file. This application is mainly intended to work with the openmoko framework so end users will be able to run application uppon events without too much effort, though that isn't a limitation. For example, one can set the aux button to launch the dialer and the other can set a sound when screen is dimmed with as little as no effort.

(The default config file is set to run the porfile-changer when the aux button is pressed for more than a second)

Contents

Package

  • author: Tom Hacohen <available_at_profile>
  • this is a python script so code resides in /usr/bin/siglaunchd (hopefuly in a public svn soon)
  • link: package

How To Use

siglaunchd connects to predefined dbus signals checks some parameters and if the signal matches the application associated with it is launched.

This daemon reads the configuration file looking for records of the type: bin=interface;busname;path;signal;rule1,rule2...
While:

  • bin is the binary to run (and parameters)
  • interface, busname, path and signal are dbus related
  • rules are seperated by a ',' and look like id(=|<|>)value.

For example if I a rule to check if the first parameter got from the dbus signal equals to "test" the rule will be: 0=test


Example configuration file line: "DISPLAY=:0.0 openmoko-terminal2"=org.freesmartphone.Device.Input;org.freesmartphone.oeventsd;/org/freesmartphone/Device/Input;Event;0=AUX,1=released,2>1


I used this configuration to run the openmoko-terminal2 everytime I held the aux button for 2 seconds or more.

You can actually add as many lines you want to the config and associate as many applications needed to a single signal with different/same rules(in different lines) .

This daemon is designed for use with the openmoko framework, read about the framework dbus signals at: http://git.freesmartphone.org/?p=specs.git;a=blob_plain;f=html/index.html

Please send me feedback about bugs/suggestions. Enjoy.

Change Log

0.1.3:

  • added a scripts dir in /usr/share/siglaunchd/scripts/ that's the proper place to put custom user scripts (and stock example ones)
  • wrote the profile-changer app, a script packed with the siglaunchd that controls the framework's phone profile using a gui.

TODO

  • upgrade the rules system (add more complex variable types for comparison in the rules)
  • add errors (and a log file?) when the configuration file is broken
  • build sample applications to go with it
  • < and > only supports floats, add string support (= works with strings).
  • add support for SIGHUP so configuration will be loaded without app restart
  • change the config files to be in xml/other format instead of the current custom one

List of users configs

This is a list of config lines users added. If you use any custom config yourself (you should, the stock config is a demo) please add it here so others may use them as well.

AUX button - Launch The profile-changer (STOCK)

"DISPLAY=:0.0 /usr/share/siglaunchd/scripts/profile-changer"=org.freesmartphone.Device.Input;org.freesmartphone.oeventsd;/org/freesmartphone/Device/Input;Event;0=AUX,1=released,2>0

AUX button - Launch Terminal

"DISPLAY=:0.0 openmoko-terminal2"=org.freesmartphone.Device.Input;org.freesmartphone.oeventsd;/org/freesmartphone/Device/Input;Event;0=AUX,1=released,2>1

Personal tools


This project is daemon which listens to dbus signals and runs applications accordingly. The signals, application to run and some rules that will be evaluated against incoming dbus signals can be easily changed in the configuration file. This application is mainly intended to work with the openmoko framework so end users will be able to run application uppon events without too much effort, though that isn't a limitation. For example, one can set the aux button to launch the dialer and the other can set a sound when screen is dimmed with as little as no effort.

(The default config file is set so open moko terminal will be run when the aux button is pressed for two or more seconds)

Package

  • author: Tom Hacohen <available_at_profile>
  • this is a python script so code resides in /usr/bin/siglaunchd (hopefuly in a public svn soon)
  • link: package

How To Use

siglaunchd connects to predefined dbus signals checks some parameters and if the signal matches the application associated with it is launched.

This daemon reads the configuration file looking for records of the type: bin=interface;busname;path;signal;rule1,rule2...
While:

  • bin is the binary to run (and parameters)
  • interface, busname, path and signal are dbus related
  • rules are seperated by a ',' and look like id(=|<|>)value.

For example if I a rule to check if the first parameter got from the dbus signal equals to "test" the rule will be: 0=test


Example configuration file line: "DISPLAY=:0.0 openmoko-terminal2"=org.freesmartphone.Device.Input;org.freesmartphone.oeventsd;/org/freesmartphone/Device/Input;Event;0=AUX,1=released,2>1


I used this configuration to run the openmoko-terminal2 everytime I held the aux button for more than 2 seconds.

You can actually add as many lines you want to the config and associate as many applications needed to a single signal with different/same rules(in different lines) .

This daemon is designed for use with the openmoko framework, read about the framework dbus signals at: http://git.freesmartphone.org/?p=specs.git;a=blob_plain;f=html/index.html

Please send me feedback about bugs/suggestions. Enjoy.

TODO

  • upgrade the rules system (add more complex variable types for comparison in the rules)
  • add errors (and a log file?) when the configuration file is broken
  • build sample applications to go with it
  • < and > only supports floats, add string support (= works with strings).
  • add support for SIGHUP so configuration will be loaded without app restart
  • change the config files to be in xml/other format instead of the current custom one

List of users configs

This is a list of config lines users added. If you use any custom config yourself (you should, the stock config is a demo) please add it here so others may use them as well.

AUX button - Launch Terminal (stock)

"DISPLAY=:0.0 openmoko-terminal2"=org.freesmartphone.Device.Input;org.freesmartphone.oeventsd;/org/freesmartphone/Device/Input;Event;0=AUX,1=released,2>1