Ask / Submit
1

how to trigger shell scripts on dbus event? [answered]

asked 2014-02-07 11:24:43 +0300

droll gravatar image

on n900, you could install a dbus script in /etc/dbus-scripts.d and this script would filter dbus events so that only the ones you want will trigger it. the trigger event can then call a separate shell script.

how can i do the same in sailfish?

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by droll
close date 2014-02-08 03:52:02.141669

Comments

yes, related but that one uses python . i don't want to use python.

droll ( 2014-02-07 16:26:23 +0300 )edit

Just wanted to pint out that this question had been closed with a reason that an has been accepted but there is no Answer checked. Also, when the correct answer has been selected this could be tagged as how-toand the title edited to start with 'HowTo: .'. This way it would be in alignment with other how-to's .. Thanks.

foss4ever ( 2014-02-08 10:51:30 +0300 )edit

3 Answers

Sort by » oldest newest most voted
3

answered 2014-02-07 18:04:51 +0300

holgern gravatar image

updated 2014-02-07 18:09:02 +0300

I found the following: http://stackoverflow.com/questions/5344390/how-to-continuously-monitor-rhythmbox-for-track-change-using-bash/5345462#5345462 or http://unix.stackexchange.com/questions/80143/how-to-create-a-daemon-which-would-be-listening-to-dbus-and-fire-script-on-messa

The following works on my Jolla:

dbus-monitor | while read LINE; do echo $LINE; done

This can be used for a simple script.

edit flag offensive delete publish link more

Comments

interesting. but my script would see every dbus event...not as efficient but you are right, it would work too. thx!

droll ( 2014-02-07 21:21:43 +0300 )edit

How does this affect power consumption?

Stefanix ( 2014-02-08 13:23:53 +0300 )edit

power consumption - have not tested it yet but would not expect it to be significant at all. dbus-monitor is very light.

droll ( 2014-02-09 05:44:40 +0300 )edit
1

answered 2014-02-07 16:51:41 +0300

unai_i gravatar image

I'm not very familiar with systemd yet (started to learn since I got my Jolla). But I think this is something you can do with a systemd unit.

edit flag offensive delete publish link more

Comments

i luke this idea and initial reading seems to indicate it is possible to do this. will explore more. thanks.

droll ( 2014-02-07 21:20:41 +0300 )edit
1

answered 2014-02-08 03:51:38 +0300

droll gravatar image

found the answer . turns out holgren is along the correct path. look here

http://blog.fpmurphy.com/2009/02/dbus-monitor.html

edit flag offensive delete publish link more

Question tools

Follow
5 followers

Stats

Asked: 2014-02-07 11:24:43 +0300

Seen: 1,458 times

Last updated: Feb 08 '14