View Single Post
Posts: 502 | Thanked: 366 times | Joined on Jun 2010 @ /dev/null
#14
There is a way I think which would work, that is by using dbus-scripts.:

1) You will need to create a new file (as root) inside /etc/dbus-scripts.d/. The filename should preferrably end with .conf. In my instance I was using dbus-scripts to add extra functionality (key locking) to my BH-905 so I named my .conf file as bh-905.conf. The conf file should have the permissions: 644 or basically `chmod 644 /etc/dbus-scripts.d/insert_name_of_file_here.conf' as root.

Contents of the file can vary, in my case I made dbus-scripts listen for Bluetooth override signal to run the script I made, in your case you may need to point it to mediaplayer and possibly if you wanted to you can make dbus-script run the program from a different signal. Here is mine:
/root/bt_force_key * * org.maemo.Playback.Manager BluetoothOverride

As you can see the first part is the script to run, in my case its a script, in your case you can probably point it to mediaplayer. The rest of the information are just for you specifically specifying which signals should trigger this event, from senders, destinations, interface, member, etc.

More information can be found here.

2) If you decide to run your own script you will obviously need to create a new file for dbus-scripts to read once it picked up the triggered signal. The script file that you create will need to have perms 755 or `chmod 755 /path/to/script'. If you choose mediaplayer, it should already have relevant world execute permissions.

3) Last but not least, you will need to enable dbus-scripts. Under the link provided above, scroll down to the section `Running dbus-scripts on the session bus'. That is where you will need to modify and to make sure that it will run the setup even after reboots.

There are plenty of information on getting dbus-scripts to work the way you want including some examples on the very same wiki entry above.
 

The Following User Says Thank You to tuxsavvy For This Useful Post: