X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=scripts%2Fafm-util;h=170def6eb425e77fb015b5da058deb966ad89b13;hb=refs%2Ftags%2Fdab_4.0.0;hp=243b43c6c133ae96981ce09b34baa1b1fdeb4627;hpb=011a41f695cbc7aa5deca2dcee77ccf9d21f5823;p=src%2Fapp-framework-main.git diff --git a/scripts/afm-util b/scripts/afm-util index 243b43c..170def6 100755 --- a/scripts/afm-util +++ b/scripts/afm-util @@ -6,11 +6,19 @@ fi export DBUS_SESSION_BUS_ADDRESS pretty() { - sed \ - -e '/^method return .*/d' \ - -e 's/^Error org.freedesktop.DBus.Error.Failed: "\?\(.*\)"\?$/ERROR: \1/' \ - -e 's/^ string "\(.*\)"/\1/' \ - -e 's/},/&\n/' + sed ' /^method return .*/d + s/^Error org.freedesktop.DBus.Error.Failed: "\?\(.*\)"\?$/ERROR: \1/ + s/^ string "\(.*\)"/\1/ + s:[[{,]:&\n:g + s: *[]}]:\n&:g + ' | + sed ' s:^ *:: + s: *$:: + /[]}],*$/ {x;s:...::;x} + G + /[[{]\n/ {x;s:$: :;x} + s:^\(.*[^\n]\)\n\( *\)$:\2\1: + ' } send() { @@ -20,6 +28,7 @@ send() { org.AGL.afm.user.$1 \ "string:$2" | pretty + return ${PIPESTATUS[0]} } case "$1" in @@ -52,6 +61,16 @@ case "$1" in send start "\"$i\"" ;; + run-remote|start-remote) + i=$2 + send start '{"id":"'"$i"'","mode":"remote"}' + ;; + + once) + i=$2 + send once "\"$i\"" + ;; + terminate|kill) i=$2 send terminate "$i" @@ -96,6 +115,8 @@ The commands are: run id start id start an instance of the widget of id + once id run once an instance of the widget of id + kill rid terminate rid terminate the running instance rid