/knob-keyboard

/home/andrefs/.cargo/bin/knob-keyboard

Primary LanguageRust

Knob keyboard control

A simple command-line tool for interpreting key codes from a knob keyboard and running commands.

Description

This Rust application accepts integer values corresponding to the knob keyboard control keys and executes commands.

Supported key codes

  • Rotate knob left (keycode 186): Lower system volume by 10%
  • Rotate knob left (keycode 188): Raise system volume by 10%

Additional values 183, 184, 185 (keys) and 187 (knob click) are not yet implemented.

Usage

cargo run -- <value>

Where <value> is one of: 183, 184, 185, 186, 187, 188

Examples

# Lower volume
cargo run -- 186

# Raise volume
cargo run -- 188

Requirements

  • Rust (latest stable version)
  • pactl command (part of PulseAudio)

Building

cargo build --release

Installation

After building, the binary will be available at target/release/ and can be copied to your PATH, or installed automatically with

cargo install --path .