Use xdotool
which can fake keyboard/mouse input, window management, and more.
Sample usage based on the install_mt4-xdot.sh
script which installs Windows app under wine:
wine setup.exe & echo "Waiting to initialize..." while ! WID=$(xdotool search --name "Setup"); do sleep 2 done echo "Sending installer keystrokes..." >&2 xdotool key --window $WID --delay 500 space Tab Tab Tab Return Tab Tab Tab space Alt+n echo "Waiting for installer to finish..." >&2 xwininfo -id $WID -tree while pgrep -l setup; do sleep 5; done echo "Waiting program to start..." >&2 while ! WID=$(xdotool search --name "Title - *"); do sleep 2 done echo "Closing application..." >&2 xdotool key --window $WID --delay 500 Escape Escape Alt+f x sleep 1 wineserver -k echo "Installation successful." >&2
Using xdotool
you can control any app or window.
However if it's wine app only ran under Xvfb, you can also consider using winetricks
.