If you use a Linux box to display some infos in a public space , you might not have the possibility to connect a mouse and keyboard every time you need to click on the page.
For example, at work we use a TV to display some metrics with grafana,
Sometime, when we reboot the machine , the identification cookie will be outdated and the browser will land on the authentication page instead.
Since the machine has no keyboard and mousse attached this cause some issues , .
So I’ve used the tool xdotool that allow a privileged ssh user or a script to interact with the mouse and keyboard
An important step is to select the screen on witch you want to send mouses clicks and keystrokes.
xxxxxxxxxx
export DISPLAY=:0
After that lets say your screen is displaying a full-screen browser with a login page ,
By default the cursor is already in the login form.
for the example , the login/password are going to be admin/admin
xxxxxxxxxx
#for typing the login
xdotool key a && xdotool key d && xdotool key m && xdotool key i && xdotool key n
#to advance to the password form
xdotool key Tab
#for typing admin again in the password prompt.
xdotool key a && xdotool key d && xdotool key m && xdotool key i && xdotool key n
#then tab gain to go the login button , and push Enter to send the form
xdotool key Tab && xdotool key KP_Enter
you are now logged and you dashboard will display