@@ -1,7 +1,4 @@ |
| 1 | 1 | # HyprKVM |
| 2 | | -(noun) : yer a wizard, 'arry |
| 3 | | - |
| 4 | | -### what? |
| 5 | 2 | |
| 6 | 3 | Hyprland-native software KVM switch that integrates with workspace navigation. |
| 7 | 4 | |
@@ -9,71 +6,198 @@ Hyprland-native software KVM switch that integrates with workspace navigation. |
| 9 | 6 | |
| 10 | 7 | - **Workspace-integrated switching**: Move past your last workspace to switch machines |
| 11 | 8 | - **Mouse edge switching**: Standard screen-edge triggers like Synergy/Barrier |
| 12 | | -- **Hyprland keybind switching**: Trigger switches between machines using your movefocus hyprland binds |
| 13 | | -- **Encrypted connections**: TLS with certificate pinning |
| 14 | | -- **Clipboard sharing**: Sync clipboard between machines |
| 15 | | -- **GUI and CLI**: Visual layout editor or config-file driven |
| 9 | +- **Hyprland keybind switching**: Trigger switches using your movefocus Hyprland binds |
| 10 | +- **TLS encryption**: Secure connections with TOFU (Trust On First Use) certificate pinning |
| 11 | +- **Clipboard sharing**: Automatic clipboard sync between machines |
| 16 | 12 | |
| 17 | | -## Status |
| 13 | +## Installation |
| 18 | 14 | |
| 19 | | -🚧 **Early Development** |
| 15 | +### Arch Linux (AUR) |
| 20 | 16 | |
| 21 | | -## Building |
| 17 | +```bash |
| 18 | +yay -S hyprkvm |
| 19 | +# or |
| 20 | +paru -S hyprkvm |
| 21 | +``` |
| 22 | 22 | |
| 23 | | -### Prerequisites |
| 23 | +### NixOS / Nix |
| 24 | 24 | |
| 25 | | -- Rust 1.75+ |
| 26 | | -- GTK4 development libraries (for future GUI) |
| 27 | | -- Hyprland |
| 25 | +Add to your flake inputs: |
| 28 | 26 | |
| 29 | | -### Arch Linux / CachyOS |
| 27 | +```nix |
| 28 | +{ |
| 29 | + inputs.hyprkvm.url = "github:tenseleyFlow/hyprKVM"; |
| 30 | +} |
| 31 | +``` |
| 30 | 32 | |
| 31 | | -```bash |
| 32 | | -sudo pacman -S rust gtk4 libadwaita |
| 33 | +Then add to your packages: |
| 34 | + |
| 35 | +```nix |
| 36 | +environment.systemPackages = [ |
| 37 | + inputs.hyprkvm.packages.${pkgs.system}.default |
| 38 | +]; |
| 33 | 39 | ``` |
| 34 | 40 | |
| 35 | | -### NixOS |
| 41 | +Or use the standalone flake directly: |
| 36 | 42 | |
| 37 | 43 | ```bash |
| 38 | | -nix develop # When flake is available |
| 44 | +nix run github:tenseleyFlow/hyprKVM -- daemon |
| 39 | 45 | ``` |
| 40 | 46 | |
| 41 | | -### Build |
| 47 | +### Build from Source |
| 42 | 48 | |
| 43 | 49 | ```bash |
| 50 | +# Clone |
| 51 | +git clone https://github.com/tenseleyFlow/hyprKVM.git |
| 52 | +cd hyprKVM |
| 53 | + |
| 54 | +# NixOS |
| 55 | +nix develop |
| 44 | 56 | cargo build --release |
| 57 | + |
| 58 | +# Arch Linux / CachyOS |
| 59 | +sudo pacman -S rust wayland libxkbcommon openssl |
| 60 | +cargo build --release |
| 61 | + |
| 62 | +# Binaries output to target/release/hyprkvm and target/release/hyprkvm-ctl |
| 45 | 63 | ``` |
| 46 | 64 | |
| 47 | 65 | ## Quick Start |
| 48 | 66 | |
| 49 | | -1. Start the daemon: |
| 50 | | - ```bash |
| 51 | | - ./target/release/hyprkvm daemon |
| 52 | | - ``` |
| 53 | | - |
| 54 | | -2. Configure neighbor machines in `~/.config/hyprkvm/hyprkvm.toml`: |
| 55 | | - ```toml |
| 56 | | - [machines] |
| 57 | | - self_name = "my-laptop" |
| 58 | | - |
| 59 | | - [[machines.neighbors]] |
| 60 | | - name = "desktop" |
| 61 | | - direction = "right" |
| 62 | | - address = "desktop.local:24850" |
| 63 | | - ``` |
| 64 | | - |
| 65 | | -3. Optionally, install keybinding interceptors in your `hyprland.conf`: |
| 66 | | - ```ini |
| 67 | | - bind = SUPER, Left, exec, ~/.config/hypr/scripts/hyprkvm-move.sh left |
| 68 | | - bind = SUPER, Right, exec, ~/.config/hypr/scripts/hyprkvm-move.sh right |
| 69 | | - bind = SUPER, Up, exec, ~/.config/hypr/scripts/hyprkvm-move.sh up |
| 70 | | - bind = SUPER, Down, exec, ~/.config/hypr/scripts/hyprkvm-move.sh down |
| 71 | | - ``` |
| 67 | +### 1. Configure |
| 68 | + |
| 69 | +Create `~/.config/hyprkvm/hyprkvm.toml`: |
| 70 | + |
| 71 | +```toml |
| 72 | +[machines] |
| 73 | +self_name = "laptop" |
| 74 | + |
| 75 | +[[machines.neighbors]] |
| 76 | +name = "desktop" |
| 77 | +direction = "right" |
| 78 | +address = "192.168.1.100:24850" |
| 79 | +``` |
| 80 | + |
| 81 | +Each machine needs its own config pointing to its neighbors. |
| 82 | + |
| 83 | +### 2. Start the Daemon |
| 84 | + |
| 85 | +```bash |
| 86 | +# If installed via package manager |
| 87 | +hyprkvm daemon |
| 88 | + |
| 89 | +# If built from source |
| 90 | +./target/release/hyprkvm daemon |
| 91 | +``` |
| 92 | + |
| 93 | +### 3. First Connection |
| 94 | + |
| 95 | +On first connection, you'll be prompted to trust the remote machine's certificate fingerprint. This is stored in `~/.config/hyprkvm/known_hosts.toml` for future connections. |
| 96 | + |
| 97 | +### 4. Usage |
| 98 | + |
| 99 | +- **Mouse**: Move cursor to screen edge with a configured neighbor |
| 100 | +- **Escape**: Press Scroll Lock (or triple-tap Shift) to return control |
| 101 | + |
| 102 | +## CLI Commands |
| 103 | + |
| 104 | +```bash |
| 105 | +# Start the daemon |
| 106 | +hyprkvm daemon |
| 107 | + |
| 108 | +# View logs |
| 109 | +hyprkvm-ctl logs |
| 110 | + |
| 111 | +# Check status |
| 112 | +hyprkvm-ctl status |
| 113 | +``` |
| 72 | 114 | |
| 73 | 115 | ## Configuration |
| 74 | 116 | |
| 117 | +### Neighbor Machines |
| 118 | + |
| 119 | +```toml |
| 120 | +[[machines.neighbors]] |
| 121 | +name = "desktop" |
| 122 | +direction = "right" # left, right, up, down |
| 123 | +address = "192.168.1.100:24850" |
| 124 | +# fingerprint = "SHA256:..." # Optional: pre-trust certificate |
| 125 | +``` |
| 126 | + |
| 127 | +### Network & TLS |
| 128 | + |
| 129 | +```toml |
| 130 | +[network] |
| 131 | +listen_port = 24850 |
| 132 | +bind_address = "0.0.0.0" |
| 133 | +connect_timeout_secs = 5 |
| 134 | +ping_interval_secs = 5 |
| 135 | +ping_timeout_secs = 10 |
| 136 | + |
| 137 | +[network.tls] |
| 138 | +# Auto-generated if missing |
| 139 | +cert_path = "~/.config/hyprkvm/cert.pem" |
| 140 | +key_path = "~/.config/hyprkvm/key.pem" |
| 141 | +``` |
| 142 | + |
| 143 | +### Escape Hotkey |
| 144 | + |
| 145 | +```toml |
| 146 | +[input.escape_hotkey] |
| 147 | +key = "scroll_lock" |
| 148 | +modifiers = [] # e.g., ["super"] for Super+ScrollLock |
| 149 | + |
| 150 | +[input] |
| 151 | +triple_tap_enabled = true |
| 152 | +triple_tap_key = "shift" |
| 153 | +triple_tap_window_ms = 500 |
| 154 | +``` |
| 155 | + |
| 156 | +### Clipboard |
| 157 | + |
| 158 | +```toml |
| 159 | +[clipboard] |
| 160 | +enabled = true |
| 161 | +sync_on_enter = true |
| 162 | +sync_on_leave = true |
| 163 | +sync_text = true |
| 164 | +sync_images = true |
| 165 | +max_size = 10485760 # 10MB |
| 166 | +``` |
| 167 | + |
| 168 | +### Logging |
| 169 | + |
| 170 | +```toml |
| 171 | +[logging] |
| 172 | +level = "info" # error, warn, info, debug, trace |
| 173 | +``` |
| 174 | + |
| 75 | 175 | See [config/hyprkvm.example.toml](config/hyprkvm.example.toml) for all options. |
| 76 | 176 | |
| 177 | +## Hyprland Keybind Integration (Optional) |
| 178 | + |
| 179 | +Intercept workspace movement to trigger machine switching: |
| 180 | + |
| 181 | +```ini |
| 182 | +# ~/.config/hypr/hyprland.conf |
| 183 | +bind = SUPER, Left, exec, hyprkvm-ctl move left |
| 184 | +bind = SUPER, Right, exec, hyprkvm-ctl move right |
| 185 | +bind = SUPER, Up, exec, hyprkvm-ctl move up |
| 186 | +bind = SUPER, Down, exec, hyprkvm-ctl move down |
| 187 | +``` |
| 188 | + |
| 189 | +## Firewall |
| 190 | + |
| 191 | +Open port 24850 (or your configured port): |
| 192 | + |
| 193 | +```bash |
| 194 | +# UFW |
| 195 | +sudo ufw allow 24850/tcp |
| 196 | + |
| 197 | +# firewalld |
| 198 | +sudo firewall-cmd --add-port=24850/tcp --permanent |
| 199 | +sudo firewall-cmd --reload |
| 200 | +``` |
| 77 | 201 | |
| 78 | 202 | ## License |
| 79 | 203 | |