V tomto návode ukážem, ako ovládať Linux - pracovnú plochu pomocou Bash. Pre robota Bash sú potrebné nasledujúce balíky:
$ apt-get install xdotool xclip
#!/bin/bash
#mouse bewegen
xdotool mousemove 100 200
#Mouse - Koordinaten erfassen
xdotool getmouselocation
#Mouse-klick
xdotool click 1
Mouse-Klick auf Koordinaten
xdotool mousemove 100 200 click 1
#usw...
V nasledujúcom príklade sa vyhľadá okno prehliadača Firefox a otvorí sa nová karta s adresou Ubuntu:
WID=$(xdotool search firefox | head -n1) ## Window-ID von Firefox ermitteln
xdotool windowactivate $WID
xdotool key "ctrl+t" ## neuen Reiter öffnen
xdotool key "ctrl+l" ## Fokussieren der Adressleiste
xdotool type --delay 100 "ubuntuusers.de" ## Internetadresse eintippen
xdotool key "Return" ## Internetadresse aufrufen
Prečo potrebujete xclip???
Pomocou nástroja xdotools/“ctrl c” môžete kopírovať obsah do vyrovnávacej pamäte a čítať alebo spracovať ho pomocou xclip v skripte bash.