Created
September 13, 2021 15:00
-
-
Save rwese/3377a761f796c54a2f11873858ceaaa3 to your computer and use it in GitHub Desktop.
get the event device by name for a keyboard or mouse on linux
This file contains 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
#!/bin/bash | |
# read the /proc/bus/input/devices and then parse out the proper event device | |
# this can be used in conjuction with kmonad *https://github.com/kmonad/kmonad) | |
DEVICE_NAME="Logitech MX Keys" | |
EVENT=$(grep "$DEVICE_NAME" /proc/bus/input/devices -A 4 | tail -n1 | grep -Eo 'event[0-9]+') | |
DEVICE="/dev/input/$EVENT" | |
echo "Found device at: $DEVICE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Full kmonad start script example, dirty but gets the job done.
I also have split the configuration into multiple .lisps as I have separate use-cases, work/gaming.