Skip to content

Configuration

dnaidoo621 edited this page May 30, 2026 · 1 revision

Configuration

Idle timeout

By default the QR popup reappears after 2 hours of no connected devices. Change it with HTPC_REMOTE_IDLE_TIMEOUT (value in seconds).

Using a systemd drop-in (recommended — survives upgrades):

systemctl --user edit htpc-remote

This opens an editor. Add:

[Service]
Environment=HTPC_REMOTE_IDLE_TIMEOUT=3600

Save and close. The drop-in is stored in ~/.config/systemd/user/htpc-remote.service.d/ and is never touched by upgrades.

Reload and restart:

systemctl --user daemon-reload
systemctl --user restart htpc-remote

Common values:

Value Meaning
1800 30 minutes
3600 1 hour
7200 2 hours (default)
14400 4 hours
0 Revert to old behaviour — popup on every disconnect

Server port

The server listens on port 7000 by default. To change it, set HTPC_REMOTE_PORT in the same drop-in:

[Service]
Environment=HTPC_REMOTE_PORT=8080

If you change the port, update your firewall rule too:

sudo ufw allow 8080/tcp
sudo ufw delete allow 7000/tcp

Pointer and scroll sensitivity

These are per-client settings adjusted in the Tune tab on the phone — they live in the phone's browser session and don't persist in any server config. There's nothing to configure server-side.

If you want to change the defaults, edit window.HTPC in web/static/ws.js:

window.HTPC = { sensitivity: 2.0, scrollSpeed: 1.0 };

Full environment variable reference

Variable Default Description
HTPC_REMOTE_IDLE_TIMEOUT 7200 Seconds before popup reappears after last disconnect
HTPC_REMOTE_PORT 7000 Port the FastAPI server listens on
XDG_SESSION_TYPE (from login session) Set to x11 or wayland to force a specific backend
DISPLAY (from login session) Required for X11 — set automatically by the service
WAYLAND_DISPLAY (from login session) Required for Wayland — set automatically by the service

Checking active configuration

# See all environment variables the service is running with
systemctl --user show-environment

# See the effective service config including drop-ins
systemctl --user cat htpc-remote

Clone this wiki locally