free5lot / hid-apple-patched

Allows to swap the Fn key and left Control key and other tweaks on Macbook Pro and Apple keyboards in GNU/Linux
GNU General Public License v2.0
349 stars 61 forks source link

Step by step instructions for Manjaro linux / Arch linux? #57

Closed hyperfocus1337 closed 4 years ago

hyperfocus1337 commented 4 years ago

It seems the instructions for Manjaro/Arch are different compared to the Ubuntu instructions in the README of the repo. I have a new Apple Magic Keyboard 2 and so far I haven't able to figure out how to get the patch to work. The Arch wiki Apple Keyboard is useful but difficult to parse for newbies.

I've installed the AUR package hid-apple-patched-git-dkms, which already creates the configuration file /etc/modprobe.d/hid_apple_pclayout.conf making the instructions in the README unnecessary. The command sudo update-initramfs -u doesn't work in Manjaro/Arch, it seems mkinitcpio is the equivalent utility.

The Arch wiki mentions: After installation the change is not picked up by the kernel immediately. The simplest way is to just reboot your system and the new behavior should be in effect. This doesn't seem to be the case for my system. Several times I have tried installing the patch and rebooting which doesn't seem to cause the key changes. I've tried booting in 5.3 and 5.4 kernel versions, in 4.19 the keyboard doesn't seem to be working at all due to missing hid_apple drivers.

This is the part of the wiki where I get lost: Note: Do not forget to include the configuration file in initramfs otherwise it will not work automatically after boot. Refer to Mkinitcpio#BINARIES and FILES or Mkinitcpio#HOOKS (the hook you might need is called modconf about how to do that).

When I open the configuration file /etc/mkinitcpio.conf, I can see an empty BINARIES=() configuration array. Am I supposed to put something here?

I've tried running: sudo modprobe -r hid_apple; sudo modprobe hid_apple to no avail. And I've also tried running sudo depmod -a and sudo mkinitcpio -p linux54 and rebooted afterwards, which also didn't seem to work. It seems it made the /sys/module/hid_apple directory disappear.

When I run dkms status I can see the following information:

hid-apple-patched, 20191222.536e16a, 4.14.160-1-MANJARO, x86_64: installed
hid-apple-patched, 20191222.536e16a, 4.19.91-1-MANJARO, x86_64: installed
hid-apple-patched, 20191222.536e16a, 5.3.18-1-MANJARO, x86_64: installed
hid-apple-patched, 20191222.536e16a, 5.4.6-2-MANJARO, x86_64: installed

Anyhow, I'm lost, can someone point me in the right direction with clear step by step instructions?

free5lot commented 4 years ago

I'm not using Manjaro/Arch, so I hope someone with this specific knowledge will help you here.

almson commented 4 years ago

Note that at the moment, the Magic Keyboard 2 only works through USB, not Bluetooth.

The instructions are just to install hid-apple-patched-git-dkms from AUR and reboot, provided you installed kernel headers, which you did.

free5lot commented 4 years ago

@hyperfocus1337 and @almson can you figure out the current state of this issue? I mean AUR package probably should be updated now to include this bluetooth upstream changes but maybe currently installation around AUR is an options?

free5lot commented 4 years ago

@Aetf as a maintainer of https://aur.archlinux.org/packages/hid-apple-patched-git-dkms/ could you please check current version and update AUR?

almson commented 4 years ago

Re-installing the AUR package will pull the latest commit (because it's a -git package), but for existing users to see an update the version in AUR needs to be bumped.

Actually, there is also an issue with installing the AUR package where initramfs is not rebuilt. Rebuilding manually can be done with sudo mkinitcpio -P all. I'm not sure what PKGBUILD option is needed to do this automatically. @Aetf do you know?

Aetf commented 4 years ago

There is a pacman hook for rebuilding initramfs, but that's only for kernel updates and alike. I think I can just add a notice to the message after installing the package.

Aetf commented 4 years ago

I updated the package, which now includes a link to the wiki page on how to update initramfs. I also updated the wiki page to have more specific instructions.

https://wiki.archlinux.org/index.php/Apple_Keyboard#Including_the_configuration_file_in_initramfs

almson commented 4 years ago

Let's continue this conversation in #31 Current issue should be closed as a duplicate. Sorry for posting here.

free5lot commented 4 years ago

@hyperfocus1337 so, your information and desire for instructions for Arch/Manjaro was acknowledged and may result to adding small instruction block to README. The further feedback is recommended to be provided in the issue #31. If you think that it's not a duplicate or something else about closing this issue - feel free to post here and ask for reopen.

free5lot commented 4 years ago

@hyperfocus1337 detailed instruction for installation on Arch Linux was added to arch wiki (related PR #64)

https://wiki.archlinux.org/index.php/Apple_Keyboard#Use_a_patch_to_hid-apple