mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
7bd08e683c
All bashisms should be fixed (hopefully). Signed-off-by: Uli Schlachter <psychon@znc.in>
38 lines
685 B
Bash
Executable file
38 lines
685 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# rlwrap provides readline to stuff which doesn't know readline by itself
|
|
RLWRAP=`which rlwrap 2>/dev/null`
|
|
|
|
if [ "$RLWRAP" != "" ]
|
|
then
|
|
if [ "$A_RERUN" = "" ]
|
|
then
|
|
A_RERUN="no" exec $RLWRAP $0
|
|
fi
|
|
else
|
|
USE_READLINE="-e"
|
|
fi
|
|
|
|
DBUS_SEND=dbus-send
|
|
|
|
which ${DBUS_SEND} > /dev/null
|
|
if test $? = 1
|
|
then
|
|
echo "E: Unable to find" ${DBUS_SEND}
|
|
exit 1
|
|
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
|
|
}
|
|
|
|
while read ${USE_READLINE} -r -p "awesome# " line
|
|
do
|
|
a_dbus_send "$line"
|
|
done
|