Linux or Windows laptop as a Bluetooth LE keyboard and mouse for a tablet or phone.
  • Rust 89.1%
  • Python 6.6%
  • HTML 4.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
JJ Macalinao 676f86564d
All checks were successful
ci / test (push) Successful in 2m6s
release / release (push) Successful in 2m21s
chore: release 0.1.7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:00:56 +08:00
.cargo chore: link the Windows build statically 2026-11-02 19:03:49 +08:00
.forgejo/workflows feat: add an app launcher entry that starts bluff 2026-11-22 17:20:57 +08:00
.github/workflows feat: copy each Forgejo release to the GitHub mirror 2026-11-10 13:36:53 +08:00
brandkit feat: render a Windows exe icon in the brand kit 2026-11-02 20:26:30 +08:00
contrib feat: add an app launcher entry that starts bluff 2026-11-22 17:20:57 +08:00
src fix: forget a host when BlueZ removes its device object 2026-11-24 14:22:08 +08:00
.gitignore chore: remove the Python version 2026-11-02 19:04:55 +08:00
build.rs fix: embed version info, a manifest and an icon in bluff.exe 2026-11-02 20:26:30 +08:00
Cargo.lock chore: release 0.1.7 2026-11-24 15:00:56 +08:00
Cargo.toml chore: release 0.1.7 2026-11-24 15:00:56 +08:00
LICENSE docs: license bluff under Apache-2.0 2026-11-02 20:36:26 +08:00
README.md feat: add an app launcher entry that starts bluff 2026-11-22 17:20:57 +08:00

bluff

Your laptop's keyboard and touchpad, on your tablet or phone

Use a Linux or Windows laptop's keyboard and touchpad on an iPad or any other device that pairs with Bluetooth LE keyboards. The laptop pretends to be a Bluetooth LE keyboard and mouse (HID over GATT), so the device needs no app; it pairs with bluff like any other keyboard.

Built for Wayland compositors with no input-capture portal (Niri): bluff reads /dev/input directly and takes an exclusive grab while the device has control.

Requirements

  • BlueZ 5.56+ with an adapter that supports the LE peripheral role (bluetoothctl show lists peripheral under Roles)
  • Membership in the input group, for /dev/input/event*
  • Rust 1.85 or later, to build from source

Use

Download the package for your distribution from the releases page and install it:

sudo apt install ./bluff_*_amd64.deb          # Debian, Ubuntu
sudo dnf install ./bluff-*.x86_64.rpm         # Fedora
sudo pacman -U bluff-*-x86_64.pkg.tar.zst     # Arch

Then add yourself to the input group (log out and back in after) and start bluff as a user service tied to the graphical session:

sudo usermod -aG input "$USER"
systemctl --user enable --now bluff

On another distribution, unpack bluff-*-x86_64-linux.tar.gz and put bluff in ~/.local/bin, bluff.service in ~/.config/systemd/user, bluff.desktop in ~/.local/share/applications and bluff.svg in ~/.local/share/icons/hicolor/scalable/apps. The release binaries need glibc 2.36 or later.

To build from source instead:

cargo install --path . --root ~/.local
install -Dm644 contrib/bluff.service ~/.config/systemd/user/bluff.service
install -Dm644 contrib/bluff.desktop ~/.local/share/applications/bluff.desktop
install -Dm644 brandkit/logo/bluff-icon.svg ~/.local/share/icons/hicolor/scalable/apps/bluff.svg
systemctl --user enable --now bluff

bluff puts an icon in the system tray (any StatusNotifierItem tray: KDE, Waybar, DankMaterialShell and others; GNOME needs the AppIndicator extension). If you quit bluff from the tray, start it again from your app launcher (the "bluff" entry) or with systemctl --user start bluff.

  1. Pick "Pair a new device…" in the tray menu. bluff becomes discoverable for two minutes.
  2. On the device, open its Bluetooth settings and pick bluff. iPadOS may list it under the laptop's Bluetooth name instead.
  3. A notification shows the six-digit code. Accept it if the device shows the same code.
  4. Click the tray icon, or press and release Ctrl+Alt+Super together, to send input to the device. Press the hotkey again to take it back.

iPadOS does not repeat keys held on bluff, so bluff repeats them itself at the laptop's key repeat rate. Held letters repeat too, where an Apple keyboard would show the accent picker.

Outside pairing mode bluff is not discoverable and refuses every pairing request; a bonded device reconnects on its own. Without a tray, stop the service and run bluff --pair in a terminal to pair there instead.

With more than one device paired, the tray menu lists them and input goes to the checked one only. All of them stay connected, so picking another device switches over at once. A newly paired device becomes the checked one. When a device reconnects, bluff may re-register its keyboard with BlueZ so the device subscribes again; any other connected device then pauses for a second or two. bluff keeps the addresses of the devices it paired in ~/.local/state/bluff/hosts; devices paired before that file existed need their address added there by hand.

After pulling changes to a source build: cargo install --path . --root ~/.local --force and systemctl --user restart bluff. Logs: journalctl --user -u bluff -f. bluff --version prints the version; the tray menu and the first log line show it too.

If the device disconnects, input returns to the laptop on its own. Stopping bluff releases the grab too.

Options: --hotkey LEFTCTRL+LEFTALT+LEFTMETA, --name, --adapter, --pixels-per-mm (touchpad speed), --mm-per-tick (scroll speed). The device's own pointer speed and natural-scrolling settings apply on top.

Windows

Needs Windows 11 24H2 or later and a Bluetooth adapter that supports the LE peripheral role. Download bluff-*-x86_64-windows.zip from the releases page and extract bluff.exe from it.

To build it yourself, install rustup and unpack llvm-mingw (the ucrt-x86_64 zip) with its bin folder on PATH, then from a clone:

rustup toolchain install stable-x86_64-pc-windows-gnullvm
cargo +stable-x86_64-pc-windows-gnullvm build --release

That gives a single target\release\bluff.exe.

Copy bluff.exe anywhere. Run it from a terminal, or put a shortcut to it in shell:startup to start it at sign-in. bluff opens no window; quit it from the tray menu. Run from a terminal, it logs there.

The tray icon and hotkey work as on Linux, with these differences:

  • Windows runs pairing. Pick "Pair a new device…" in the tray menu, then pick this computer's name (not bluff) on the device, and confirm the pairing in the Windows prompt. Outside pairing mode bluff is not discoverable; paired devices still reconnect.
  • The tray menu lists only the devices connected right now.
  • The pointer follows Windows' own pointer speed and acceleration, so --pixels-per-mm has no effect, and --name and --adapter are ignored. Two-finger scrolling on a precision touchpad does follow --mm-per-tick.
  • While input goes to the device, the touchpad's own two-finger scrolling is off. If bluff is killed at that moment, scrolling stays off until you sign out, or toggle "Drag two fingers to scroll" in the touchpad settings.
  • Ctrl+Alt+Del always reaches Windows, and input to an elevated (admin) window stays on the laptop unless bluff runs elevated too.
  • Remembered devices and the chosen one live in %LOCALAPPDATA%\bluff.

Uninstall

On Linux, stop the service, remove the package, and delete the list of paired devices:

systemctl --user disable --now bluff
sudo apt remove bluff        # Debian, Ubuntu
sudo dnf remove bluff        # Fedora
sudo pacman -R bluff         # Arch
rm -r ~/.local/state/bluff

From the tarball or a source build, delete ~/.local/bin/bluff, ~/.config/systemd/user/bluff.service, ~/.local/share/applications/bluff.desktop and ~/.local/share/icons/hicolor/scalable/apps/bluff.svg instead of removing a package.

On Windows, pick "Quit bluff" in the tray menu, delete its shortcut from shell:startup, then delete bluff.exe and %LOCALAPPDATA%\bluff.

Then forget bluff in the device's Bluetooth settings, and remove the device from the laptop's.

If pairing fails

If the device shows bluff as connected and then drops the pairing a moment later, the laptop's Bluetooth controller may still hold keys from an earlier pairing with that device. This can happen after the device forgot bluff while BlueZ failed to clear the device from the controller. Turn the adapter off and on, then pair again:

bluetoothctl power off
bluetoothctl power on

Other Bluetooth devices, such as headphones, disconnect for a moment. To confirm the cause first, run sudo btmon during a pairing attempt: it shows SMP: Pairing Failed with Reason: DHKey check failed (0x0b).

Limits

  • One finger moves, two fingers scroll, click with two fingers to right-click. There is no tap-to-click and there are no iPadOS trackpad gestures: those need Apple's Magic Trackpad protocol. Use the Globe-key shortcuts instead.
  • A device paired with bluff cannot also play audio through the laptop (Linux). bluff refuses its Bluetooth audio connections, because a device that comes back on audio after the laptop resumes does not reconnect to bluff.
  • No clipboard sharing.

Releasing

Bump version in Cargo.toml, commit, then tag and push:

git tag v0.2.0
git push origin main v0.2.0

CI builds the Linux packages and the Windows zip and attaches them to a release for the tag. The tag must match the version in Cargo.toml.

Forgejo mirrors the tag to GitHub, where .github/workflows/release.yml waits for the Forgejo release and copies its files to a GitHub release. To copy an existing release, run that workflow by hand with the tag.

License

Apache License 2.0; see LICENSE. The fonts in brandkit/fonts keep their own licenses, next to each font.