Created
December 13, 2021 14:47
-
-
Save oboxodo/1af17e64969893d56551d6bc4e9f5f19 to your computer and use it in GitHub Desktop.
Change Apple Keyboard layout to work as a PC keyboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# https://github.com/torvalds/linux/blob/2585cf9dfaaddf00b069673f27bb3f8530e2039c/drivers/hid/hid-apple.c#L38-L58 | |
# https://blog.desdelinux.net/en/apple-keyboard-work-properly-ubuntu/ | |
# fnmode | |
# Mode of fn key on Apple keyboards | |
# 0 = disabled, [1] = fkeyslast, 2 = fkeysfirst | |
echo 2 > /sys/module/hid_apple/parameters/fnmode | |
# swap_opt_cmd | |
# Swap the Option ("Alt") and Command ("Flag") keys. | |
# For people who want to keep PC keyboard muscle memory. | |
# [0] = as-is, Mac layout, 1 = swapped, PC layout. | |
echo 1 > /sys/module/hid_apple/parameters/swap_opt_cmd | |
# swap_fn_leftctrl | |
# Swap the Fn and left Control keys. | |
# For people who want to keep PC keyboard muscle memory. | |
# [0] = as-is, Mac layout, 1 = swapped, PC layout. | |
echo 1 > /sys/module/hid_apple/parameters/swap_fn_leftctrl | |
# F13 = Insert | |
# echo "keycode 191 = Insert" | xmodmap - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment