tbocek/dvorak

How to run

alensiljak opened this issue · 9 comments

I'm trying to run after compilation on OpenSuse Tumbleweed and it is throwing the following error:

error: specify input device, e.g., found in /dev/input/by-id/.

Am I missing something? The ReadMe does not specify how to invoke the binary with any parameters.

And, to answer my own question (I've just switched to linux again after a while):

/dev/input/by-id contains a list of available input devices. One of those is a keyboard and points to the stream name (i.e. event2).
Adding /dev/input/event2 as a parameter works. Many thanks for this!

After passing this initial hurdle, it seems I can't get past

Cannot open any of the devices: Permission denied.

even though I've added my user to the input group and added the rule to /etc/udev/rules.d

After restart, it seems that the input group membership works.

Cannot open /dev/uinput: Permission denied.

Unfortunately, there is no uinput group in the system and /dev/uinput only has root root.
Added the uinput group with members myself,root.
Reloaded rules with

sudo udevadm control --reload-rules && udevadm trigger

but to no avail.

You need to create a uinput group in that case (as you did), add your user and set the rules as follows: https://github.com/tuomasjjrasanen/python-uinput/blob/master/udev-rules/40-uinput.rules

Thomas, thanks a lot for assistance.
I've added the following

SUBSYSTEM=="misc", KERNEL=="uinput", MODE="0660", GROUP="uinput"

to (a new file) /etc/udev/rules.d/40-uinput.rules.
After reboot I'm still getting Cannot open /dev/uinput: Permission denied.
At least it feels I'm closer to the goal. :)
I'll read a bit more about udev rules on OpenSuse.

There is a workaround by running ~/bin/dvorak /dev/input/event2 with sudo, of course.

Finally, after another reboot, /dev/uinput has the proper permissions assigned. Now I can run the command as an ordinary user.

Strangely, the shortcut keys do not work at all although they did when I initially tried it with sudo.

Got it, finally.
The keyboard has, in the meantime, changed it's event number to event3 hence the run command did not work as it was referencing event2. Voila!

Updated installation instructions a bit as a result. Thanks!