Switch ALT with CMD on Apple keyboards on Linux with Kernel 3.13

A feature introduced in kernel 3.13 enables you to easily switch alt and cmd keys on apple keyboards. The following is for Fedora 20:

Switch alt and cmd temporarily (as root). Note that GNOME 3 didn’t seem to realize that during my limited testing, whereas Mate picked it up on the fly:

echo "1" > /sys/module/hid_apple/parameters/swap_opt_cmd

Edit/create /etc/rc.d/rc.local with the following contents to make this permanent:

#!/bin/sh
echo "1" > /sys/module/hid_apple/parameters/swap_opt_cmd

Make it executable:

chmod 700 /etc/rc.d/rc.local

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax