Skip to content

Instantly share code, notes, and snippets.

@espoelstra
Last active September 29, 2023 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save espoelstra/7ee5912d58dd1cc707fc91b1b20180bc to your computer and use it in GitHub Desktop.
Save espoelstra/7ee5912d58dd1cc707fc91b1b20180bc to your computer and use it in GitHub Desktop.
udev hwdb.d config to get the behavior to match the labels
# Copyright 2019 The ChromiumOS Authors
# Distributed under the terms of the GNU General Public License v2
#
# Special keyboard mapping for the Sarien project. The keyboard emits both
# function and action scan codes depending on Fn-modifier key.
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDell*:pnSarien:pvr*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDell*:pnArcada:pvr*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDell*:pnDrallion:pvr*
KEYBOARD_KEY_ea=back
KEYBOARD_KEY_e7=refresh
KEYBOARD_KEY_d5=full_screen
KEYBOARD_KEY_d6=scale
KEYBOARD_KEY_95=brightnessdown
KEYBOARD_KEY_91=brightnessup
KEYBOARD_KEY_a0=mute
KEYBOARD_KEY_ae=volumedown
KEYBOARD_KEY_b0=volumeup
KEYBOARD_KEY_8b=switchvideomode
KEYBOARD_KEY_d8=sleep
KEYBOARD_KEY_d4=kbd_layout_next

Notes on use

cd /etc/udev/hwdb.d/ && sudo curl -L -o 81-sarien-arcada-drallion-keyboard.hwdb 'https://gist.githubusercontent.com/espoelstra/7ee5912d58dd1cc707fc91b1b20180bc/raw/81-sarien-arcada-drallion-keyboard.hwdb'

and then run

sudo systemd-hwdb update && sudo udevadm control --reload-rules && sudo udevadm trigger /sys/class/input/event2 && sudo udevadm info /sys/class/input/event2

and your F1-F9 keys should now send the correct keycode/action matching their labels. Tested on Fedora and Ubuntu so far, hoping to test on Alpine/postmarketOS with eudev at some point. I may change the d4 to Left_Meta/Super key for easier muscle memory (and also remap the existing Search/Left_Meta/Super key into a Caps key to use caps2esc or similar to make it Esc + Ctrl at the user level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment