Get XKB keyboard layout from river using the river-xkb-config-v1 wayland protocol
- Zig 100%
| protocol | added missing protocol | |
| src | added invalid option error for command line parser | |
| build.zig | cleanup and minimize | |
| build.zig.zon | initial commit | |
| LICENSE | initial commit | |
| README.md | README: typo fix | |
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?