2009-04-30 00:26:53 +02:00
|
|
|
#!/bin/bash
|
2009-04-08 17:30:18 +02:00
|
|
|
|
2009-04-18 12:26:31 +02:00
|
|
|
# rlwrap provides readline to stuff which doesn't know readline by itself
|
|
|
|
RLWRAP=`which rlwrap 2>/dev/null`
|
|
|
|
|
2009-04-30 00:27:03 +02:00
|
|
|
if [ "$RLWRAP" != "" ]
|
2009-04-18 12:26:31 +02:00
|
|
|
then
|
2009-04-30 00:27:03 +02:00
|
|
|
if [ "$A_RERUN" = "" ]
|
|
|
|
then
|
|
|
|
A_RERUN="no" exec $RLWRAP $0
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
USE_READLINE="-e"
|
2009-04-18 12:26:31 +02:00
|
|
|
fi
|
|
|
|
|
2009-04-08 17:30:18 +02:00
|
|
|
DBUS_SEND=dbus-send
|
|
|
|
|
|
|
|
if ! which ${DBUS_SEND} >/dev/null 2>&1
|
|
|
|
then
|
|
|
|
echo "E: Unable to find" ${DBUS_SEND}
|
|
|
|
fi
|
|
|
|
|
|
|
|
DBUS_METHOD=org.awesome.Remote.Eval
|
|
|
|
DBUS_PATH=/
|
|
|
|
DBUS_DEST=org.awesome
|
|
|
|
|
|
|
|
a_dbus_send()
|
|
|
|
{
|
|
|
|
$DBUS_SEND --dest=$DBUS_DEST --type=method_call --print-reply $DBUS_PATH \
|
|
|
|
$DBUS_METHOD string:"$1" | tail -n +2
|
|
|
|
}
|
|
|
|
|
2009-04-30 00:27:03 +02:00
|
|
|
while read ${USE_READLINE} -r -p "awesome# " line
|
2009-04-08 17:30:18 +02:00
|
|
|
do
|
|
|
|
a_dbus_send "$line"
|
|
|
|
done
|