waymon

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2025 License: MIT Imports: 2 Imported by: 0

README

Waymon

Wayland Mouse Over Network - A seamless input sharing solution for Wayland that allows you to control multiple computers with a single mouse and keyboard, similar to Synergy/Barrier but built specifically for modern Wayland compositors.

⚠️ Early Development Stage: This project is in active development. While the core functionality is working, expect breaking changes and rough edges. Contributions and feedback are welcome!

Features

Working
  • Seamless mouse movement between computers by moving to screen edges
  • Mouse button events (left, right, middle click)
  • Keyboard input forwarding
  • Secure SSH transport with key-based authentication
  • Real-time TUI for monitoring connections and status
  • Automatic input release on client disconnect
  • Emergency release mechanisms (Ctrl+ESC, timeout, manual)
In Progress
  • 🚧 Absolute mouse positioning
  • 🚧 Cursor constraints
  • 🚧 Improved display boundary detection
  • 🚧 Edges detection and switching
  • 🚧 Multiple monitor support on client
  • 🚧 Multiple simultaneous client support
  • 🚧 Clipboard synchronization (TBD)

How It Works

Waymon captures input events on the server (the one with the physical keyboard and mouse) using Linux's evdev interface, forwards them over an encrypted SSH connection to the client, and injects them using Wayland's virtual input protocols. When you move your mouse to the edge of your screen, control seamlessly switches between computers.

Requirements

Server (Computer being controlled)
  • Linux with Wayland compositor
  • Root/sudo access (for evdev input capture)
  • SSH server
  • Port 52525 available (configurable)
Client (Computer you're controlling from)
  • Linux with Wayland compositor supporting:
    • zwp_virtual_pointer_v1 protocol
    • zwp_virtual_keyboard_v1 protocol
  • SSH client with key-based authentication
Tested Compositors
  • ✅ Hyprland
  • ⚠️ GNOME Wayland (needs testing)
  • ⚠️ KDE Wayland (needs testing)

Installation

git clone https://github.com/bnema/waymon.git
cd waymon
go build -o waymon .
sudo mv waymon /usr/local/bin/
The Go Install way
go install github.com/bnema/waymon@latest

Quick Start

  1. On the server (computer to be controlled):

    sudo waymon server
    
  2. On the client (computer you're controlling from):

    waymon client --host SERVER_IP:52525
    
  3. First connection: You'll be prompted on the server to approve the client's SSH key

  4. Start using: Move your mouse to the edge of the screen to switch control!

Server Controls

When running the server, you can use these keyboard shortcuts in the TUI:

  • 0 or ESC: Return control to local (server) system
  • 1-5: Switch control to connected client by number
  • R: Manual emergency release (when controlling a client)
  • Tab: Cycle through connected clients
  • G/g: Navigate logs (bottom/top)
  • Q: Quit server

Emergency Release

If input gets stuck while controlling a client, Waymon provides multiple release mechanisms:

  1. Ctrl+ESC: Emergency key combination (when grabbed)
  2. R key: Manual release in server TUI
  3. 30-second timeout: Automatic release after inactivity
  4. Client disconnect: Automatic release when client disconnects
  5. SIGUSR1: Send signal to server process: sudo pkill -USR1 waymon
  6. Touch file: Create /tmp/waymon-release to trigger release

Configuration

Waymon uses TOML configuration files. Create ~/.config/waymon/waymon.toml:

[server]
port = 52525
bind_address = "0.0.0.0"
name = "my-desktop"
max_clients = 1
ssh_whitelist_only = true
log_level = "INFO"          # Set to "DEBUG" for troubleshooting

[client]
server_address = "192.168.1.100:52525"
auto_connect = false
reconnect_delay = 5
edge_threshold = 5
# Hotkey switching disabled by default during alpha
# hotkey_key = "s"
# hotkey_modifier = "ctrl+alt"

[display]
backend = "auto"            # auto, wlr, sudo, or randr

Troubleshooting

Debug Logging

Enable debug logs by setting the environment variable:

sudo LOG_LEVEL=DEBUG waymon server
Common Issues

"Failed to grab device: device or resource busy"

  • Another application may be using exclusive input access
  • Try closing other input management tools

"Emergency release triggered"

  • This is a safety feature - input was inactive for 30 seconds
  • Increase timeout in code if needed (will be configurable soon)

Mouse clicks not working

  • Fixed in latest version - update if you're on an older build
  • Check debug logs for button mapping issues

Keyboard input showing wrong characters

  • Keymap synchronization is not yet implemented
  • Both systems should use the same keyboard layout

Architecture

graph LR
  subgraph "Server (where physical mouse/keyboard are)"
    direction TB
    evdev["Linux Input Event Devices<br>(/dev/input/event*)"] --> server_app["Waymon Server Process<br>(captures evdev events)"]
  end

  subgraph "Client (controlled remotely)"
    direction TB
    client_app["Waymon Client Process<br>(receives events)"] --> virtual_input["Wayland Virtual Input<br>(injects events)"]
  end

  server_app -- "Input Events (Protobuf) over<br>Encrypted SSH Tunnel" --> client_app

Contributing

Contributions are welcome! Areas where help is needed:

  • Testing on different Wayland compositors
  • Security review
  • Documentation improvements
  • Bug reports and fixes
  • Multiple monitor support
  • TUI polish
  • Synergy - Commercial cross-platform solution
  • Barrier - Open-source fork of Synergy
  • Input-leap - Barrier fork with Wayland support
  • waynergy - Synergy client for Wayland
  • lan-mouse - Rust-based input sharing

License

MIT License - see LICENSE file for details

Acknowledgments

  • Built with Bubble Tea for the TUI
  • Uses Wish for SSH server
  • Protocol Buffers for efficient serialization
  • The Wayland community for protocol documentation

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
test-display command
test-display shows detected monitor configuration
test-display shows detected monitor configuration
internal
config
Package config handles configuration management using Viper
Package config handles configuration management using Viper
display
Package display handles monitor detection and cursor tracking
Package display handles monitor detection and cursor tracking
ipc
server
Package server implements the Waymon server with privilege separation
Package server implements the Waymon server with privilege separation
ui
Package ui provides consistent styling and components for the Waymon CLI
Package ui provides consistent styling and components for the Waymon CLI
tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL