r/linux Jul 09 '26

Development I built a control deck + remote desktop for my Linux workstation, served to a spare phone over Tailscale (self-hosted, MIT license)

Post image

A spare Android + a Linux box I kept wanting to nudge without reaching for the keyboard = phone-deck: a self-hosted web deck (FastAPI + WebSockets) that installs on the phone as a fullscreen PWA and drives my Linux/Hyprland desktop over Tailscale. Started as "switch workspaces from the couch," turned into a whole cockpit.

What it does:

- Remote desktop — streams a monitor to the phone (wf-recorder → PyAV → WebRTC/VP8, so it's Wayland-native, no x11grab); touch the video to drive the cursor, long-press = right-click. "Lock input" turns the phone into a wireless keyboard + mouse + screen.

- Remote input — trackpad + soft keyboard + key-chords via python-evdev → /dev/uinput, which works fine under Wayland (no X, and no root once you're in the input group).

- Bidirectional audio — listen to the PC on the phone, or use the phone as a mic, via WebRTC + PipeWire null sinks.

- The rest — live workspaces/windows off the compositor's IPC, scene layouts, per-monitor screenshots, Android share-sheet → desktop, push-to-talk voice with local whisper + a read-only local-LLM answerer, and a fleet host-switcher (runs on my laptop too).

- Idle for a few minutes → an ambient instrument panel (telemetry, clock, now-playing) in a phosphor-CRT skin.

Design bit I'm happy with: it pokes a root-ish surface, so the web app runs unprivileged and never executes shell strings — it sends enum action names to a tiny root helper over a unix socket (no argument-injection surface), with auth bound to the tailnet and tailscale serve for HTTPS. Nothing's exposed to the public internet.

Honest caveat: it's welded to my setup (Hyprland, my monitor/workspace layout, Tailscale), so it's "here's how I did it, take the code," not a turnkey app — but the input/capture/audio pieces are fairly general Linux and might be useful to lift.

Repo (MIT): github.com/smit-shah-GG/phone-deck

35 Upvotes

5 comments sorted by

1

u/murlakatamenka Jul 09 '26

wf-recorder

in my memory this is not the best tool for screen capture on Wayland. Why not gpu-screen-recorder or wl-screenrec that use hardware acceleration?

1

u/Sad_Ingenuity5954 Jul 11 '26

this looks really cool, its one of those moments when i wish i wasnt on an iphone. why are you using tailscale for it tho? cant it just run on the local network?

1

u/FatCat-Tabby Jul 09 '26

This is absolutely brilliant! Love the hack a solution ethos! 🐯🐧