Skip to content

Instantly share code, notes, and snippets.

@questionlp
Created March 15, 2026 03:04
Show Gist options
  • Select an option

  • Save questionlp/4e0964414aee8ea82bbb90feb89812c6 to your computer and use it in GitHub Desktop.

Select an option

Save questionlp/4e0964414aee8ea82bbb90feb89812c6 to your computer and use it in GitHub Desktop.
Fedora and t2linux: Set `fnmode` to `2` on system startup

Create /usr/lib/systemd/system/mac-keyboard.service with the following contents:

[Unit]
 Description=mac-keyboard
[Service]
 Type=oneshot
 ExecStart=/bin/sh -c "echo 2 > /sys/module/hid_apple/parameters/fnmode"
 ExecStop=/bin/sh -c "echo 1 > /sys/module/hid_apple/parameters/fnmode"
 RemainAfterExit=yes
[Install]
 WantedBy=multi-user.target

Run the following commands to enable and start the service:

sudo systemctl daemon-reload && sudo systemctl enable --now mac-keyboard.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment