Here the best setup (I think so :D) for Keychron + Linux
- Step 1: Set fkeyfirst by:
- Create the file
/etc/modprobe.d/hid_apple.conf
. Add this line to the file:options hid_apple fnmode=2
- Save the file and execute the following command:
sudo update-initramfs -u
- Reboot
- Create the file
- Step 2: Use the keyboard in Windows/Android mode
- Step 3: If get stuck with numpad mode: Double hit F6 or fn + F6. I've been using this config since the very first day, both bluetooth and cable with no problem.
Alternative config:
- For step 1: you can just do
echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode
instead. - But the setting will be reset after reboot, so the method above is to make sure that the setting is permanent after reboot. Also someone recommends to create a udev rule for keychron devices.
- Edit the file /etc/bluetooth/main.conf
- Uncomment FastConnectable config and set it to true:
FastConnectable = true
- Uncomment
ReconnectAttempts=7
(set the value to whatever number that you want) - Uncomment
ReconnectIntervals=1, 2, 3
Run the following command:
echo -e "# Disable autosuspend for btusb to make the bluetooth keyboard work again\noptions btusb enable_autosuspend=n" | sudo tee /etc/modprobe.d/btusb_disable_autosuspend.conf
Now reboot your computer, or run:
sudo modprobe -r btusb
sudo service bluetooth restart
sudo modprobe btusb
Create and edit a file that will be executed every time the computer wakes up:
sudo nano /lib/systemd/system-sleep/bt
Add this to its contents:
#!/bin/sh
case $1 in
post)
modprobe -r btusb
sleep 1
service bluetooth restart
sleep 1
modprobe btusb
;;
esac
Make it executable
sudo chmod +x /lib/systemd/system-sleep/bt