2014-08-29 15:31:46 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2016-07-18 22:16:49 +00:00
|
|
|
echo -e -n "aap\nnoot\nmies" | rofi -width -30 -dmenu -multi-select > output.txt &
|
2014-08-29 15:31:46 +00:00
|
|
|
RPID=$!
|
|
|
|
|
|
|
|
# send enter.
|
|
|
|
sleep 5;
|
2014-08-30 18:45:08 +00:00
|
|
|
xdotool key 'c'
|
2014-08-29 15:31:46 +00:00
|
|
|
sleep 0.2
|
2014-08-30 18:45:08 +00:00
|
|
|
xdotool key 'o'
|
2014-08-29 15:31:46 +00:00
|
|
|
sleep 0.2
|
2014-08-30 18:45:08 +00:00
|
|
|
xdotool key 'f'
|
2014-08-29 15:31:46 +00:00
|
|
|
sleep 0.2
|
2014-08-30 18:45:08 +00:00
|
|
|
xdotool key 'f'
|
2014-08-29 15:31:46 +00:00
|
|
|
sleep 0.2
|
2014-08-30 18:45:08 +00:00
|
|
|
xdotool key 'e'
|
2014-08-29 15:31:46 +00:00
|
|
|
sleep 0.2
|
2014-08-30 18:45:08 +00:00
|
|
|
xdotool key 'e'
|
2014-08-29 15:31:46 +00:00
|
|
|
sleep 0.2
|
2014-08-30 18:45:08 +00:00
|
|
|
xdotool key Return
|
2014-08-29 15:31:46 +00:00
|
|
|
|
2014-08-31 07:44:42 +00:00
|
|
|
|
2014-08-29 15:31:46 +00:00
|
|
|
# Get result, kill xvfb
|
|
|
|
wait ${RPID}
|
|
|
|
RETV=$?
|
2019-02-02 11:35:37 +00:00
|
|
|
OUTPUT=$( tr '\n' ' ' < output.txt )
|
2016-07-22 14:25:49 +00:00
|
|
|
if [ "${OUTPUT}" != 'coffee ' ]
|
2014-08-29 15:31:46 +00:00
|
|
|
then
|
|
|
|
exit 1
|
|
|
|
fi
|
2014-08-31 07:44:42 +00:00
|
|
|
|
|
|
|
OUTPUT=$(rofi -dump-xresources)
|
|
|
|
if [ -z "${OUTPUT}" ]
|
|
|
|
then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2014-08-29 15:31:46 +00:00
|
|
|
exit ${RETV}
|