Skip to content
Dhiva-LabsPublic

About

Turn your phone into a programmable macro pad (a Stream Deck replacement) for Ubuntu and Windows — QR pairing over Wi-Fi or Bluetooth.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

KeyDeck

ARM64 builds Linux x64 | arm64 Windows x64 | arm64 Linux: deb | rpm | Arch | AppImage | Flatpak

Turn your phone into a programmable macro pad (a Stream Deck replacement) for your Ubuntu or Windows machine.

Documentation: step-by-step guides at learn.dhivalabs.com: install · beginner guide · troubleshooting.

  • Mobile app (Android/iOS, Flutter) — the pad itself. Grids of 4, 6, 8 or 10 big keys. Tap a key and the desktop executes whatever you programmed.
  • Desktop app (Ubuntu/Windows on x64 and arm64, Flutter) — the host. Shows the pairing QR code, lets you program every key, and injects the keystrokes.
  • Connect over WiFi or Bluetooth — same session token, either medium.
  • QR pairing — the desktop shows a QR code; scan it with the phone to start a session. The QR carries the host IPs, port and a per-launch secret token, so nothing on your network can send you keystrokes uninvited.

Repo layout

Directory What it is
protocol/ Pure-Dart shared package: models, wire messages, QR payload, BLE framing
desktop/ Flutter desktop host (Linux + Windows, x64 + arm64)
mobile/ Flutter mobile pad (Android + iOS)

How it works

┌────────── phone ──────────┐              ┌───────── desktop ─────────┐
│ scan QR → SessionInfo     │              │ shows QR (ips+port+token) │
│                           │   WiFi       │                           │
│ WsTransport ── hello ─────┼──────────────▶ PadServer (WebSocket)     │
│              ◀─ ack+layout┤              │                           │
│ tap key ──── key ─────────┼──────────────▶ KeyInjector executes      │
│                           │              │                           │
│ BleTransport (peripheral, │   Bluetooth  │ BleHost (central, scans   │
│ advertises GATT service)  ◀──────────────┤ and connects)             │
└───────────────────────────┘              └───────────────────────────┘

Key programming lives entirely on the desktop; the phone only ever receives labels and colors. Actions per key:

  • Hotkey — e.g. Ctrl+Shift+T, media keys included
  • Text — types a snippet into the focused window
  • Command — runs a shell command (launch apps, scripts…)

Each pad size (4/6/8/10) keeps its own set of programmed keys, and edits sync to a connected phone live.

Running

Download the desktop app

The desktop host is built for Linux and Windows on both x64 and arm64. GitHub releases from 0.2.1 on carry these files, attached by the CI workflow; every CI run also keeps all of them as workflow artifacts. The Android pad APK is attached to the release by hand:

Platform File
Ubuntu/Debian x64 keydeck_<version>_amd64.deb
Ubuntu/Debian arm64 keydeck_<version>_arm64.deb
Linux (any distro) KeyDeck-<version>-linux-x64.tar.gz, KeyDeck-<version>-linux-arm64.tar.gz
Windows KeyDeck-<version>-windows-x64.zip, KeyDeck-<version>-windows-arm64.zip
sudo apt install ./keydeck_<version>_arm64.deb   # or _amd64.deb; pulls in GTK, recommends xdotool

The tarball and zip hold the whole app folder: unpack and run keydeck_desktop (keydeck_desktop.exe on Windows). Keystroke injection still needs xdotool or ydotool on Linux.

Other Linux distributions

From the next release on, releases also carry packages for other distributions, built from the same binaries as the .deb (x86_64 and aarch64):

Distribution Asset Install
Fedora, RHEL/Rocky/Alma keydeck-<version>-1.<arch>.rpm sudo dnf install ./keydeck-<version>-1.<arch>.rpm
openSUSE Tumbleweed keydeck-<version>-1.<arch>.rpm sudo zypper install --allow-unsigned-rpm ./keydeck-<version>-1.<arch>.rpm
Arch, Manjaro, EndeavourOS keydeck-<version>-1-<arch>.pkg.tar.zst sudo pacman -U ./keydeck-<version>-1-<arch>.pkg.tar.zst
Any (AppImage) KeyDeck-<version>-<arch>.AppImage chmod +x KeyDeck-<version>-<arch>.AppImage && ./KeyDeck-<version>-<arch>.AppImage
Any (Flatpak) keydeck-<version>-<arch>.flatpak flatpak install --user ./keydeck-<version>-<arch>.flatpak
  • The binaries are built on Ubuntu 24.04, so they need glibc 2.39 or newer: Fedora 40+, openSUSE Tumbleweed and current Arch, but not openSUSE Leap 15 or RHEL 9. The AppImage uses the system's GTK 3.
  • dnf and zypper install xdotool or ydotool with the .rpm (a weak dependency, like the .deb's Recommends); on Arch they are optional dependencies: sudo pacman -S xdotool (X11) or ydotool (Wayland). The AppImage and the Flatpak use whichever one the system has.
  • The .rpm files are unsigned (hence --allow-unsigned-rpm on openSUSE).
  • The Flatpak bundle uses the GNOME 51 runtime from Flathub: add the Flathub remote first (flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo). It is not sandboxed in practice: typing keystrokes and running the commands you program have to happen on your desktop, so it runs xdotool/ydotool and those commands on the host through flatpak-spawn --host (--talk-name=org.freedesktop.Flatpak). It also has network access (for the phone) and Bluetooth (BlueZ). See packaging/flatpak/README.md.
  • Arch users can build keydeck-bin from the AUR recipe attached to each release (keydeck-bin-<version>-aur.tar.gz: PKGBUILD and .SRCINFO).

Desktop (Ubuntu)

# Keystroke injection backend (pick one):
sudo apt install xdotool     # X11 sessions
sudo apt install ydotool     # Wayland sessions (needs ydotoold running)

cd desktop
flutter run -d linux          # or: flutter build linux --release

On Windows: flutter build windows --release — injection uses the built-in Win32 SendInput, nothing to install.

Flutter cannot cross-compile desktop apps, so an arm64 build is made on an arm64 machine (build/linux/arm64/..., build\windows\arm64\...); the same commands work there unchanged.

Mobile (Android)

cd mobile
flutter run                   # or: flutter build apk --release
  1. Start the desktop app — it shows a QR code.
  2. In the phone app, scan the QR code.
  3. Pick WiFi (both devices on the same network) or Bluetooth (flip the Bluetooth switch on in the desktop app so it scans for the phone).
  4. Tap keys. Program them from the desktop at any time.

Testing

cd protocol && dart test      # wire format, framing, QR payload
cd desktop && flutter test    # real WebSocket server handshake + auth

GitHub Actions (.github/workflows/desktop.yml) runs both suites, builds the desktop app and starts it, on Linux x64, Linux arm64, Windows x64 and Windows arm64, each on a native runner. It also packages the .deb, tarball and zip listed above, and the packages for other distributions: the .rpm is installed and run on Fedora and openSUSE Tumbleweed, the Arch package on Arch Linux (x64; arm64 gets a static check, as there is no official Arch Linux ARM image), the AppImage on Fedora, and the Flatpak in its sandbox.

Notes

  • The WebSocket port defaults to 8737 (falls back to a random free port).
  • The session token rotates on every desktop app launch, invalidating old QRs.
  • Bluetooth uses BLE GATT: the phone advertises the KeyDeck service as a peripheral and the desktop connects as a central, so it works without classic Bluetooth pairing.

Sponsors

Dhiva Labs is an independent, self-funded lab. Sponsorships help bring this project and the rest of Dhiva Labs to every platform, iPhone and Mac included.

Sponsor Dhiva Labs

Monthly sponsors at $10 and up are listed here:

Be the first: sponsor Dhiva Labs.

About

Turn your phone into a programmable macro pad (a Stream Deck replacement) for Ubuntu and Windows — QR pairing over Wi-Fi or Bluetooth.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages