2
1
Fork
You've already forked rivermap
0
Get XKB keyboard layout from river using the river-xkb-config-v1 wayland protocol
  • Zig 100%
Find a file
2026年03月28日 11:25:30 +01:00
protocol added missing protocol 2026年03月28日 00:32:56 +01:00
src added invalid option error for command line parser 2026年03月28日 11:25:30 +01:00
build.zig cleanup and minimize 2026年03月27日 23:32:59 +01:00
build.zig.zon initial commit 2026年03月26日 23:15:11 +01:00
LICENSE initial commit 2026年03月26日 23:15:11 +01:00
README.md README: typo fix 2026年03月28日 00:39:47 +01:00

Rivermap

Introduction

This is a simple tool that outputs the name of the XKB keyboard layout in use in river using the river-xkb-config-v1 wayland protocol.

It currently presumes only one keyboard layout is in use across all input devices.

Installation

Build and install as follows:

zig build -Doptimize=ReleaseSafe install

Usage

Run from within the river compositor:

rivermap

This outputs the index number and name of the current layout, separated by a space, and then quits.

You can also run rivermap continuously as a deamon

rivermap --daemon

This outputs the layout on every layout change.

Usage in bars

You can for example integrate this in hacker-friendly bars similar to dwmblocks/i3blocks/etc:

BARPID=$$
(rivermap -d | while read -r line; do
 #write to temporary file (memory-backed fs)
 echo "$line" > "$XDG_RUNTIME_DIR/rivermap.state"
 #send a signal to the parent to force a refresh
 kill -37 "$BARPID"
done) &

The parent script ($BARPID) can catch the signal with to update the display:

trap	"update_keyboard" "RTMIN+3" # -37

Todo

  • Ability to set xkb keyboards
  • Support multiple input devices with different keymaps?