Skip to content

Instantly share code, notes, and snippets.

@filipebraida
Forked from andrejcremoznik/k780.md
Created September 6, 2019 13:56
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 filipebraida/109d8700c6ec0994c61765886b5928b2 to your computer and use it in GitHub Desktop.
Save filipebraida/109d8700c6ec0994c61765886b5928b2 to your computer and use it in GitHub Desktop.
Logitech K780 switch media and function keys on linux

Media/function keys on K780

K780 doesn't have a hard switch to lock the function keys. Logitech provides a utility to do this on Windows and iOS but not on Linux. You need to manually remap the keys.

Below works for Arch Linux, other systemd based distros should be about the same.

There's a problem with the F1-F3 keys as they're hardware specific and don't emit an event if pressed on their own and therefore can't be remapped. I might be wrong as I haven't spend any time on researching that.

Create file /usr/lib/udev/hwdb.d/95-k780.hwdb

# Logitech K780 map:
# Fn + F4/F5/F6 ==> F4/F5/F6
evdev:input:b0003v046Dp405B*
  KEYBOARD_KEY_c0223=f4
  KEYBOARD_KEY_70065=f5
  KEYBOARD_KEY_c0224=f6

Rebuild hwdb.bin and apply new keys

sudo udevadm hwdb --update
sudo udevadm trigger

Make permanent

sudo systemctl edit --full systemd-hwdb-update.service

Comment out:
#ConditionNeedsUpdate=/etc

This creates a replacement systemd unit file in /etc/systemd/system/systemd-hwdb-update.service If some update breaks anything related to this, remove it and recreate with systemctl edit like before.

Read more

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