samvel1024 / kbct

Keyboard keycode mapping utility for Linux supporting layered configuration
269 stars 23 forks source link

Document the need for uinput module #25

Closed fauxmight closed 2 years ago

fauxmight commented 2 years ago

I have used other applications requiring the uinput module and I still managed to overlook the need to modprobe uinput prior to running kbct remap ... or starting the systemd service.

When one has not loaded the uinput module, kbcd raises no complaint or error.

It would be worth mentioning in the readme that uinput will need to be loaded with modprobe or other means prior to using kbct.

felagund commented 2 years ago

Documenting this is good, but it would be also good if KBCT complained when ther is no uinput, no?

fauxmight commented 2 years ago

@felagund No argument. I spent 20 minutes today to see if I could learn enough rust to check for the presence of a kernel module and found a whole lot of useless-to-me information about WRITING kernel modules in rust. While I think you are right to point this out, implementation is beyond me.

felagund commented 2 years ago

I think you just need to parse /proc/modules as per https://stackoverflow.com/questions/12978794/programmatically-check-whether-a-linux-kernel-module-exists-or-not-at-runtime

There is probably no API for this :-/.

fauxmight commented 2 years ago

Thanks for the push to do so. The PR is now up. I got there, but had to learn an awful lot of Rust to do very basic things (string handling and dealing with iterators instead of arrays and 'Result' as a type, mostly). I was astonished at how readily Rust instructions on even simple topics suggest "just pull in another crate."

Good learning experience, though, and it put my ego in check to realize how little I knew (and how much slower I learn than when I was 20 :)