To use Logicool K480 for Steamdeck

The Logicool K480 as a bluetooth keyboard surely can be direclty used for Steamdeck.
But as a well known issue, there is no official driver provided for Linux platform, therefore F1~F12 work as Multimedia Keys in default instead of Function Keys.

Not acceptable at all.

Noticed that an AUR package k480-function-keys-conf-git is provided as a solution, but cannot be used directly due to 2 issues:
💣 one of the checksum inside is wrong
💣 compile will fail because the linux-neptune-headers used by SteamOS has a special structure

Below is the solution to solve the issues and use it.

  1. To download the snapshot directly and extract it to your local, e.g., ./k480-function-keys-conf-git.

    https://aur.archlinux.org/cgit/aur.git/snapshot/k480-function-keys-conf-git.tar.gz

  2. To replace the checksum in both .SRCINFO and PKGBUILD

    Before: 2caee64458f1c921845f22aeae1b034eebfe3b39f9fe9b317fe0bbae500a535c
    After: 356e31ae1a2d835e020f8c54ab28eae0d4265869cb5f94c6503d02dd1f6eae32

  3. To modify below part in the PKGBUILD.

    Before:

    build() {
    cd "srcdir/srcdir/_pkgname"
    ./build.sh
    }

    After:

    build() {
    cd "srcdir/srcdir/_pkgname"
    sed -i '/gcc -o $file file.c/c\gcc -I /usr/lib/modules/(uname -r)/build/include/uapi -I /usr/lib/modules/(uname−r)/build/arch/x86/include/generated/uapi−I/usr/lib/modules/(uname -r)/build/arch/x86/include/generated/uapi -I /usr/lib/modules/(uname -r)/build/arch/x86/include/uapi -I /usr/lib/modules/$(uname -r)/build/include -o $file $file.c' ./build.sh
    ./build.sh
    }

  4. Use pacman to install packages [linux-neptune-headers glibc base-devel], then run below command in ./k480-function-keys-conf-git (the same folder PKGBUILD inside).

    makepkg -sci --noconfirm

  5. Reboot your system and F1~F12 should work as Function Keys in default now.