A simple proof-of-concept for a remote mouse app: Python server (Flask + Socket.IO) and a mobile web UI with touchpad, clicks, and scrolling.
- Python 3.10+ (recommended)
- X11 session (pyautogui is often restricted on Wayland)
- Packages for pyautogui:
python3-tkpython3-dev
Optional, but recommended:
python3-venv
sudo apt-get update
sudo apt-get install -y python3-venv python3-tk python3-dev
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt./install.sh./start.shThe terminal prints the local URL and shows a QR code.
Open that address on your smartphone browser or scan the QR code.
To start the server automatically at boot, use a systemd user service. This variant works without an explicitly set XAUTHORITY and is suitable for X11 desktops.
- Create the service file
mkdir -p ~/.config/systemd/user
cp remotemouse.service.example ~/.config/systemd/user/remotemouse.service
- Verify/adjust paths in
~/.config/systemd/user/remotemouse.service:
WorkingDirectory=/home/user/PycharmProjects/RemoteMouseExecStart=/home/user/PycharmProjects/RemoteMouse/.venv/bin/python app.py
- Load, enable, and start the service
systemctl --user daemon-reload
systemctl --user enable remotemouse.service
systemctl --user start remotemouse.service
- Optional: Start even without login (lingering)
sudo loginctl enable-linger <your-username>
- Status & logs
systemctl --user status remotemouse.service
journalctl --user -u remotemouse.service -f
Notes:
- Ensure the virtual environment exists (
./install.sh). - This setup assumes an X11 session (Wayland is usually unsuitable for pyautogui).
- Adjust username and paths to match your system.
- On X11, pyautogui usually works out of the box.
- On Wayland, mouse control and screenshots are often blocked.
- Workaround: choose an Xorg/X11 session at login.
app.py- Python server (Flask + Socket.IO, mouse control)templates/index.html- Web UI (touchpad, clicks, scrolling)requirements.txt- Python dependenciesstatic/manifest.json,static/sw.js,static/icon.svg- PWA assets