xrecord-echo
echo XRecord events by nanomsg library. Any can subsribe to it.
Event message contains info about window and process where it triggered. Message looks like that:
{
"event_type": "KeyEvent",
"xserver_time": 12255472,
"timestamp": 1441459157,
"wm_name": "alxkolm/rust-xrecord-echo - Google Chrome",
"wm_class": "Google-chrome-stable",
"pid": 5077,
"proc_name": "chrome",
"proc_cmd": "/opt/google/chrome/chrome",
"code": 11
}
- Rust compiler
- nanomsg (tested on >=0.5)
To install all of prerequisites and build xrecord-echo run:
make
# Install for systemd based linux distributions (ex. Ubuntu)
make install
To just build xrecord-echo use cargo:
cargo build --release
To run xrecord-echo use start
script. It automaticaly respawn process when it crush.
But I recommend use supervisor like runit to manage process (run on system startup and restart on crash).
xrecord-echo emit messages as publisher on port 1234.
To check that this work use nanomsg tools to subscribe and output to terminal:
nanocat --sub -l1234 -A
cp xrecord-echo.service ~/.config/systemd/user
systemctl --user enable xrecord-echo.service
systemctl --user start xrecord-echo.service
- Customize nanomsg port by command line parameters
- Implement XRecord error callback