comparison src/gaim-send @ 11331:64fadbf3810f

[gaim-migrate @ 13544] General polishing of DBus code, improving examples, removing obsolete files. committer: Tailor Script <tailor@pidgin.im>
author Piotr Zielinski <zielaj>
date Wed, 24 Aug 2005 02:34:40 +0000
parents 2eca9ed49469
children ac5bc9a7b603
comparison
equal deleted inserted replaced
11330:d41a83d221b0 11331:64fadbf3810f
1 #!/bin/bash 1 #!/bin/bash
2 #
3 # A little shell script for communicating with gaim using dbus
4 2
5 METHOD_NAME=$1 3 METHOD_NAME=$1
6 4
7 if test -z "$METHOD_NAME" 5 if test -z "$METHOD_NAME"
8 then 6 then
9 cat <<EOF 7 cat <<EOF
10 This program uses dbus to talk to gaim. If the gaim is not running and 8 This program calls gaim API functions using DBus and prints the return value.
11 the dbus engine is set up correctly, a new instance of gaim will be started. 9 If you are not interested in the return value, use gaim-send-async.
12 10
13 Syntax: gaim-send method-name parameter1 parameter2 ..." 11 Usage:
12
13 $0 method-name type1:parameter1 type2:parameter2 ...
14 14
15 This shell script just invokes dbus-send, see man dbus-send for how 15 This shell script just invokes dbus-send, see man dbus-send for how
16 to specify the parameters. 16 to specify the parameters.
17 17
18 Examples: 18 Examples:
19 19
20 gaim-send Ping 20 $0 GaimAccountsFindConnected string: string:prpl-jabber
21 gaim-send Quit 21 $0 GaimAccountsGetAll
22 gaim-send GetBuddyList 22 $0 GaimCoreQuit
23 gaim-send GetBuddyProperty int32:5 string:alias
24 gaim-send StartIMConversation int32:5
25 23
26 See src/dbus-services.xml for the list of supported operations. 24 Use dbus-viewer to get the list of supported functions and their parameters.
27 EOF 25 EOF
28
29 exit 1 26 exit 1
30 fi 27 fi
31 28
32 shift 29 shift
33 dbus-send --dest=org.gaim.GaimService --print-reply --type=method_call /org/gaim/GaimObject org.gaim.GaimInterface.$METHOD_NAME "$@" 30 dbus-send --dest=org.gaim.GaimService --print-reply --type=method_call /org/gaim/GaimObject org.gaim.GaimInterface.$METHOD_NAME "$@"