Skip to content

mikkurogue/viar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Viar

A native desktop keyboard configurator for QMK keyboards with VIA/Vial support, written in Rust.

Viar is a lightweight, Rust-native alternative to VIA and Vial. It communicates with keyboards over USB HID to remap keys and control RGB lighting in real time.

Features

  • Auto-detection and connection to VIA/Vial-enabled keyboards
  • Visual keyboard layout rendering with accurate physical key positioning
  • Real-time key remapping (changes take effect immediately on the device)
  • RGB lighting control: brightness, effect, speed, hue, saturation
  • Save lighting configuration to keyboard EEPROM
  • Export and import keymaps as JSON
  • Undo support (Ctrl+Z)
  • Automatic lighting protocol detection (VialRGB, Vial legacy, VIA channels)
  • Vial keyboard definition parsing (KLE format, LZMA-compressed from firmware)
  • Graceful device disconnection handling

Showcase

image

Preview of a keyboard layout with homerow mods as Tap Dances and with combos. Combos are shown with color matching dots on the keys that trigger their combo. image

Project Structure

crates/
  qmk-rs/         # Library: Experimental Simple qmk settings library for on-board qmk settings
  argos-rs/       # Library: Experimental rust port of the argos module by BastardKB
  via-protocol/   # Library: VIA/Vial HID protocol implementation
  viar/           # Binary: egui desktop application

via-protocol is a standalone library with no GUI dependencies. It can be used independently to build other tools that communicate with VIA/Vial keyboards. See its README for API documentation.

viar is the GUI application built with egui/eframe.

Building

Requires Rust edition 2024.

cargo build --release

Running

cargo run -p viar

With debug logging:

RUST_LOG=debug cargo run -p viar

Platform Setup

Linux

HID device access requires appropriate permissions. Add a udev rule:

# /etc/udev/rules.d/99-hid.rules
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0666"

Then reload:

sudo udevadm control --reload-rules && sudo udevadm trigger

Requirements

  • A keyboard running QMK firmware with VIA or Vial enabled
  • USB connection (no Bluetooth support)

Architecture

The application follows a layered design:

  1. Raw HID -- KeyboardDevice sends and receives 32-byte HID reports
  2. Command builder -- ViaCommand constructs typed protocol messages
  3. Protocol interface -- ViaProtocol provides high-level operations (read keymap, detect lighting, etc.)
  4. Application -- ViarApp manages UI state, user interaction, and device communication

The GUI uses egui's immediate mode rendering with a state machine (AppScreen) driving screen transitions: detection, permission errors, device selection, loading, and the connected view with keymap and lighting tabs.

License

See repository for license information.

About

Rust based via(l) firmware interface with a custom via protocol crate to do usb device hid comms with via supported split keyboards

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages