Skip to content

neverloseagain1/nvrkey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Select language / Выберите язык: 🌐 English | 🇷🇺 Русский

nvrkey ⌨️

A high-performance, full-screen ASCII keyboard visualizer written in pure Go for Linux terminals.

Unlike other visualizers, nvrkey has zero external dependencies, features an unbuffered lightning-fast TUI render engine, and automatically detects your input devices without any hardcoded paths.

✨ Features

  • Full-Screen Responsive Layout: Automatically calculates your terminal window geometry and stretches keys perfectly to fill 100% of the width.
  • Dynamic Resize Support: Listens to window change events (SIGWINCH) and snaps boundaries instantly when you tile or scale your window.
  • Zero Input Lag: Utilizes bytes.Buffer and custom flush techniques to display simultaneous multi-key presses synchronously.
  • Isolated TUI Window: Runs in an alternative screen buffer, keeping your Bash history pristine and completely preventing character leaks.
  • Custom Color Themes: Personalize your backlight on the fly.

🎨 Color Themes

You can customize the key backlight by passing the -color flag:

Preview Code Theme Color
nvrkey -color=blue 🟦 Vibrant Blue
nvrkey -color=purple 🟪 Royal Purple
nvrkey -color=cyan 🟩 Electric Cyan
nvrkey -color=red 🟥 Deep Red
nvrkey -color=yellow 🟨 Bright Yellow
nvrkey (default) 🟩 Classic Matrix Green

🛠️ Installation & Setup

1. Prerequisites

Make sure you have Go installed on your system:

# Arch Linux / EndeavourOS
sudo pacman -S go

# Ubuntu / Debian
sudo apt update && sudo apt install golang-go

# Fedora
sudo dnf install golang

2. Clone and Build

git clone https://github.com/neverloseagain1/nvrkey
cd nvrkey
go get golang.org/x/sys/unix
go build -o visualizer main.go

3. System Deployment (Global Command)

To run nvrkey from anywhere in your system without typing sudo every time, move it to /usr/local/bin and grant persistent evdev access permissions:

sudo cp ./visualizer /usr/local/bin/nvrkey
sudo setcap cap_dac_read_search=ep /usr/local/bin/nvrkey

4. Running the App

Now you can launch it from any directory using:

nvrkey -color=blue

Press Ctrl+C inside the app to safely exit and instantly restore your terminal state.


⚙️ How It Works (Under the Hood)

  1. Parallel Device Probing: On startup, the program spawns concurrent background threads (goroutines) to scan input descriptors from /dev/input/event0 to 31.
  2. Native Linux Evdev Interface: It safely opens existing streams and hooks into EV_KEY (Type 1) event patterns.
  3. Low-Level Raw Mode: Bypasses default Bash echo-mechanisms via low-level ioctl termios calls, rendering input capture fully multi-byte and Cyrillic-proof.

📄 License

This project is open-source and free to use.

Releases

No releases published

Packages

 
 
 

Contributors

Languages