Omahub
← All plugins
R

Mac Fn/Ctrl Toggle

by Rafael V. Zago

Toggle the Fn and left Ctrl roles on an Apple internal keyboard.

Security review

No obvious issues detected

Deterministic scan — not a security guarantee

None
Risk level
None
Analyzed commit
17d26ae
Scanned
1 month ago

No potentially dangerous behavior detected in the analyzed commit.

Automated analysis only — not a security guarantee.

AI advisory review

Review recommended

Language-model assessment · ~deepseek/deepseek-v4-flash-latest — advisory only

Low
AI risk level
Low
Recommendation
review
Model
~deepseek/deepseek-v4-flash-latest
Analyzed commit
17d26ae
Reviewed
1 month ago

The plugin is a transparent bar widget that toggles the hid_apple Fn/Ctrl swap through a root helper, and the setup script, helper, and sudoers rule are narrowly scoped. The deterministic scan found no issues, and there is no obfuscation or hidden destructive behavior. The main concern is that the widget runs `sudo -n` every 3 seconds, which keeps the user's sudo timestamp alive indefinitely and may weaken session security.

  • The widget periodically runs `sudo -n /usr/local/libexec/omarchy-mac-fn-ctrl status` every 3 seconds, which refreshes the user's sudo timestamp and prevents it from expiring. If the user's session is compromised, an attacker could run arbitrary sudo commands without a password.
  • The setup script writes the sudoers file before validating it with `visudo -cf`; if validation ever failed, an invalid sudoers file could remain and break sudo. The generated content is simple, so this is unlikely, but the order is not ideal.
How this check works

This review combines the deterministic scan (the rule-based results above) with an independent look at the plugin's code by a language model. The model reads a trimmed sample of the repository's files, the manifest, and the README, then gives a plain-language risk level and a recommendation: install (no notable danger), review (look closer first), or avoid (clearly dangerous).

It runs on the same analyzed commit as the deterministic scan and is strictly advisory — it is not a security guarantee and never blocks a plugin by itself. A human moderator still reviews plugins before they are listed.

AI advisory only — automated analysis, not a security guarantee.

Install
$ omarchy plugin add https://github.com/rafaelvzago/omarchy-mac-fn-key-plugin --enable
System #bar #quickshell #system

Mac Fn/Ctrl Toggle

An Omarchy Quattro bar widget that toggles the Fn and left Ctrl roles on the Apple internal keyboard using Linux's built-in hid_apple driver.

This plugin does not use keyd, xremap, or another remapping daemon. The kernel parameter is /sys/module/hid_apple/parameters/swap_fn_leftctrl.

Setup

Run the setup once from this repository. It requires administrator permission because it installs a root-owned helper and a narrow sudoers rule:

sudo ./scripts/setup
sudo -n /usr/local/libexec/omarchy-mac-fn-ctrl status

The helper accepts only status, 0, and 1. The widget invokes it with sudo -n, so missing setup never opens a password prompt from the bar.

Install from GitHub

After publishing this repository:

omarchy plugin add https://github.com/rafaelvzago/omarchy-mac-fn-key-plugin.git --enable

Run the setup command from the cloned plugin directory before using the bar toggle.

Usage

  • 󰌌: normal mapping
  • 󰌍: Fn and left Ctrl are swapped
  • ?: setup is missing or the kernel parameter is unsupported

The selected keyboard mode is persisted through driver resets and reboots. Click the icon to toggle. To remove the setup and restore normal mapping:

sudo ./scripts/uninstall

The kernel parameter applies to Apple keyboards handled by hid_apple, not to one individual device. The first release assumes the target is the built-in MacBook keyboard.

Validate

tests/run
omarchy plugin validate .
qmllint -I "$OMARCHY_PATH/shell" BarWidget.qml

Review the helper, setup script, sudoers rule, and removal behavior before enabling the plugin.