How to create dbus service from console?

Go To StackoverFlow.com

2

There are more or less straightforward ways to emit or listen signals of existing DBus services using tools like dbus-send or dbus-monitor.

How to register service and object from the shell? Expecting something like

1> dbus-service --session org.example.Test /Test
  2> qdbus org.example.Test /Test org.example.Test.Call qqq
1> qqq
  2> qdbus org.example.Test /Test org.example.Test.Call www
1> www

or like

1> dbus-service --argc=2 --session org.example.Test /Test -- /usr/bin/printf "%s Q %s\n"
  2> qdbus org.example.Test /Test org.example.Test.Call qqq ttw
1> qqq Q ttw
  2> qdbus org.example.Test /Test org.example.Test.Call www 111
1> www Q 111
2012-04-05 01:28
by Vi.
There are so many easier ways of using D-Bus that I don't feel that doing it in the shell is all that useful - Ignacio Vazquez-Abrams 2012-04-05 01:32


1

Implemented myself: http://vi-server.org/pub/dbus-shell-service.pl using this question as example.

Usage: dbus-shell-service.pl service_name command_line_arguments...
Example:
  dbus-shell-service.pl org.example.Test /usr/bin/printf '%s Q %s\n' &
  qdbus org.example.Test / org.vi_server.DbusShellService.Call2 s1 s2
  s1 Q s2
2012-04-05 02:38
by Vi.
Mirrored on githubVi. 2012-04-05 02:45
Ads