# libs export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/local/lib64:/usr/lib64 cat > README-xvfb-test.txt export DISPLAY=:5 export LD_LIBRARY_PATH=/users/pa001/reczko/deepfoldit/tools/centos:/usr/local/lib:/usr/lib:/usr/local/lib64:/usr/lib64 ./Xvfb :5 -screen 0 1024x1024x24 & ./xeyes & ./xwd -root | convert xwd:- foo.png # eyes to the center of the screen ./xdotool mousemove --sync 38 142 ./xwd -root | convert xwd:- foo.png # headless start ]0;~/bak/tools/protein/FolditStandalonereczko@max:~/bak/tools/protein/FolditStandalone$ startx -- `which Xvfb` :1 -screen 0 1024x768x24 & [1] 121616 ]0;~/bak/tools/protein/FolditStandalonereczko@max:~/bak/tools/protein/FolditStandalone$ xinit: XFree86_VT property unexpectedly has 0 items instead of 1 ]0;~/bak/tools/protein/FolditStandalonereczko@max:~/bak/tools/protein/FolditStandalone$ DISPLAY=:1 ./FolditStandalone & [2] 122347 ]0;~/bak/tools/protein/FolditStandalonereczko@max:~/bak/tools/protein/FolditStandalone$ jobs [1]- Running startx -- `which Xvfb` :1 -screen 0 1024x768x24 & [2]+ Running DISPLAY=:1 ./FolditStandalone & ]0;~/bak/tools/protein/FolditStandalonereczko@max:~/bak/tools/protein/FolditStandalone$ DISPLAY=:1 import -window root f1.png # interact with headless ]0;~/bak/tools/protein/FolditStandalonereczko@max:~/bak/tools/protein/FolditStandalone$ x11vnc -display :1 -localhost & ]0;~/bak/tools/protein/FolditStandalonereczko@max:~/bak/tools/protein/FolditStandalone$ jobs [1] Running startx -- `which Xvfb` :1 -screen 0 1024x768x24 & [2]- Running DISPLAY=:1 ./FolditStandalone & [3]+ Running x11vnc -display :1 -localhost & ]0;~/bak/tools/protein/FolditStandalonereczko@max:~/bak/tools/protein/FolditStandalone$ vncviewer :0w vncviewer :0 #record events #apt-get install xinput DISPLAY=:1 ; xinput test-xi2 --root DISPLAY=:3 ; xinput test-xi2 --root DISPLAY=:4 ; xinput test-xi2 --root #!/usr/bin/env bash save="$DISPLAY" # save original X display number export DISPLAY=:3 # set random choosen display for xvfb case "$1" in # and x-programs called below start) Xvfb $DISPLAY & ;; # starting xvfb server on :44 calc) xcalc & ;; # run x-calculator xdo) xdotool mousemove 1 1 click 1 # focus with click on x:y=1:1 xdotool key 4 asterisk 9 # calc 4*9 xdotool key equal ;; # = show) #capture root window ('36' result image) and display it to saved Xno xwd -root | xwud -display $save & ;; stop) ps auxww | grep "Xvfb $DISPLAY" | awk '{print $2}' | xargs kill ;; all) DISPLAY=$save; $0 start; $0 calc; sleep 1; $0 xdo; $0 show; $0 stop ;; esac