Is there any way to perform remote click, from let's say Android device, to current linux session with simple HTTP request?
So far I've managed to get Apache working with PHP7, and xdotool to perform left click by calling a shell script on Ubuntu 16.04 VM. The problem is that script will only work if it's called from current session, but not if it's called from php script.
My guessing would be that Apache server is run by different user in different session?
The goal of my project is to create an Android application that would send HTTP request to Linux server on which PHP will process the request and trigger shell script which performs left mouse click. In addition to that I'd love to get simple response from server which would tell me if click was successful or not.
/var/www/html folder
click.php
file permissions: -rw-r--r-- 1 root root 69 (date) click.php
<?php shell_exec('./scripts/click.sh'); ?>
./scripts/click.sh
file permissions: -rwxrwxr-x 1 root root 28 (date) click.php
#!/bin/bash
xdotool click 1