1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-11 13:50:48 -05:00
rofi/test/run_test.sh

44 lines
690 B
Bash
Raw Normal View History

#!/usr/bin/env bash
XPID=
2016-01-05 10:46:43 -05:00
FPID=
function create_fake_x ( )
{
2014-08-30 14:53:35 -04:00
export DISPLAY=":$1"
echo "Starting fake X: ${DISPLAY}"
2016-06-02 02:39:40 -04:00
Xvfb +extension XINERAMA +xinerama -screen 0 1280x1024x24 -screen 1 800x600x24 ${DISPLAY} &
XPID=$!
2016-01-07 15:27:20 -05:00
sleep 1;
2016-01-08 17:15:28 -05:00
timeout -k 30s 30s fluxbox &
2016-01-05 10:46:43 -05:00
FPID=$!
sleep 1
}
function destroy_fake_x ( )
{
if [ -n "${XPID}" ]
then
2016-01-05 10:46:43 -05:00
echo "Stopping fake X: ${XPID} - ${FPID}"
kill ${FPID}
2016-01-08 16:17:00 -05:00
echo " wait flux"
2016-01-05 10:46:43 -05:00
wait ${FPID}
kill ${XPID}
2016-01-08 16:17:00 -05:00
echo "wait x"
wait ${XPID}
fi
}
if [ -n "$3" ]
then
2014-08-30 14:53:35 -04:00
export PATH=$3:$PATH
fi
create_fake_x "$1"
2014-08-30 14:53:35 -04:00
echo "$DISPLAY"
2015-12-31 17:02:13 -05:00
$2 $4
RES=$?
destroy_fake_x
exit ${RES}