From fdd787f4b9f6fa1f48eb46d9d495c3bcf33b4df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Fri, 29 Oct 2021 20:17:53 +0200 Subject: [PATCH] Add Logitech MX Keys for Mac --- .../post/2021-10-29-logitech-mx-keys-mac.md | 45 +++++++++++++++++++ content/post/scripts/pxe.sh | 9 ++++ 2 files changed, 54 insertions(+) create mode 100644 content/post/2021-10-29-logitech-mx-keys-mac.md create mode 100755 content/post/scripts/pxe.sh diff --git a/content/post/2021-10-29-logitech-mx-keys-mac.md b/content/post/2021-10-29-logitech-mx-keys-mac.md new file mode 100644 index 0000000..a0b42ab --- /dev/null +++ b/content/post/2021-10-29-logitech-mx-keys-mac.md @@ -0,0 +1,45 @@ +--- +title: Logitech MX Keys for Mac on Linux +date: 2021-10-29 00:00:01 +tags: + - linux + - logitech + - keyboard +--- + +I recently got Logitech MX Keys for Mac keyboard at work. +The German version, to be more precise. +This version was three times cheaper than the Windows equivalent with either US or ES layout. +Since I touch type anyway, I thought it was a bargain. + +As soon as I plugged it in, I realized there were some glaring issues with the keyboard. +First of all, the Meta/Super and Alt keys are reversed in this keyboard. +In the normal/full version of this keyboard, Logitech gives an option to choose between Mac, Windows and iOS host, and that changes the behavior of the keys. +In this version, tho, only iOS and Mac are available. + +Besides that, there's the issue of the grave (tilde) and angle keys switched as well. + +Switching these keys around would be very easy with Xorg, but Wayland once again complicates things... + +These issues almost made me return the keyboard. +Luckily, tho, there is another option: configuring the keys one level lower than wayland (and X11), through hwdb. + +Long story short, this will configure any Logitech keyboard with the same product id (0x4092) to use a saner configuration: + + +```cfg +#File: /etc/udev/hwdb.d/90-logitech-keyboard.hwdb + +evdev:input:b0003v046Dp4092* + KEYBOARD_KEY_700e2=leftmeta + KEYBOARD_KEY_700e3=leftalt + KEYBOARD_KEY_70039=leftctrl + KEYBOARD_KEY_70064=grave + KEYBOARD_KEY_70035=102nd +``` + +After that, simply run: + +``` + sudo udevadm hwdb --update && sudo udevadm trigger +``` diff --git a/content/post/scripts/pxe.sh b/content/post/scripts/pxe.sh new file mode 100755 index 0000000..ea766f8 --- /dev/null +++ b/content/post/scripts/pxe.sh @@ -0,0 +1,9 @@ +#/bin/bash +USER=j +IFNAME=enp62s0u1u3 +BINARY=test-tftp.bin +ip address flush dev $IFNAME +ip address add 10.1.1.10/24 dev $IFNAME +dnsmasq -i $IFNAME --dhcp-range=10.1.1.50,10.1.1.100 \ + --dhcp-boot=$BINARY \ + --enable-tftp --tftp-root=/home/$USER/Downloads/pxe -d -u $USER -p0 -K --log-dhcp --bootp-dynamic