Use udev symlinks instead of event file paths#46
Open
Lxtharia wants to merge 2 commits intodaisyUniverse:masterfrom
Open
Use udev symlinks instead of event file paths#46Lxtharia wants to merge 2 commits intodaisyUniverse:masterfrom
Lxtharia wants to merge 2 commits intodaisyUniverse:masterfrom
Conversation
User will now be prompted for a device name. Udev rule will create a symlink with that name that links to the correct device (identified by ATTR(phys)) on reboot
make install now installs the systemd service the systemd service will be installed as user service the udev rule starts the keebie user service
Author
|
Using the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes should help with the problem, that the /dev/input/eventXX file for a device might be different after a reboot (see https://wiki.archlinux.org/title/Udev)
This issue was mentioned in #34 and @triplefox proposed steps on how to tackle this problem:
#34 (comment)
Even though there might even be a way to do this without udev, I've stuck with it, as it's needed for the systemd service anyway.
The main idea is to prompt a user for a explicit device name (instead of using
event23for example)and then let udev create a symlink like
/dev/numpad -> /dev/input/eventXXautomatically on boot.To do this, udev needs some way of identifying a device.
I've decided to use the
ATTRS(phys)attribute.The steps are now as follows:
keebie -nand gets prompted for a name (f.e.numpad1)/dev/input/event23)ATTRS(phys)is read from that device (via evdev)/dev/numpad1A configuration file looks now like this:
{ "initial_layer": "default.json", "devFile": "/dev/numpad", "udev_match_keys": [ "ATTRS(phys)==\"usb-0000:0a:00.3-2/input0\"" ], "udev_rule": "85-keebie-numpad.rules" }I have not tested it much, but I will do so in the next few days. Still wanted to open the PR now for feedback.