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

36 lines
451 B
Bash
Raw Normal View History

#!/usr/bin/env bash
XPID=
function create_fake_x ( )
{
2014-08-30 14:53:35 -04:00
export DISPLAY=":$1"
echo "Starting fake X: ${DISPLAY}"
Xvfb ${DISPLAY} &
XPID=$!
sleep 1
}
function destroy_fake_x ( )
{
if [ -n "${XPID}" ]
then
echo "Stopping fake X: ${XPID}"
kill ${XPID}
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}