Can I make a custom keyboard layout (one that wasn’t included with OS X by default) the system default — even for the login screen?

  • 1
    @Lohoris: Done! Commented Nov 3, 2013 at 17:59
  • Please update the question b removing the update note, the best answer now works on the latest osx versions as well Commented Jan 21, 2014 at 13:20

4 Answers 4


This works on OSX 10.9 Mavericks, with a keyboard layout that I created with Ukulele. Assuming that you have the layout already installed in your system, log into your account and make your custom keyboard layout active.

Open a terminal and run the following command:

cp /Library/Preferences/com.apple.HIToolbox.plist /tmp/

If you intend to use a text editor (e.g., TextWrangler) to make this change instead of XCode (which has a specialized graphical plist editor), also run:

plutil -convert xml1 /tmp/com.apple.HIToolbox.plist

Now, open /tmp/com.apple.HIToolbox.plist in the text editor or in XCode.

Throughout the file you will find several mentions of a KeyboardLayout ID key followed by an integer and KeyboardLayout Name followed by a string. Change these strings to the name of your custom keyboard layout and the id integers to the ID of your layout (the easiest way to find the right values is to compare with your user settings found in the file ~/Library/Preferences/com.apple.HIToolbox.plist.

Also the value of the key AppleCurrentKeyboardLayoutInputSourceID must be changed accordingly (probably to something like org.unknown.keylayout.NameOfYourLayout). Again you can find this value in your local preference file.

Once these changes are done, save the file and go back to the terminal. To play it safe, you can create a copy of the original com.apple.HIToolbox.plist file, just in case you made an error and need to roll back. For instance, to save a copy in your Documents folder:

sudo cp /Library/Preferences/com.apple.HIToolbox.plist ~/Documents

Then install your change with the following:

sudo sh -c 'cat /tmp/com.apple.HIToolbox.plist > /Library/Preferences/com.apple.HIToolbox.plist'

(It isn't necessary to convert your file back out of text form with plutil if you did so earlier.)

Exit the terminal, and restart the computer (logout is not sufficient: the file will not be reread). After restart, you should have your keyboard layout in the login screen.

NOTE: it's possible that it would have been enough to copy the file com.apple.HIToolbox.plist from ~/Library/Preferences/ to /Library/Preferences/, however in my case it has more entries, so I decided to play it safe and just modify the existing file.

  • Trying this right now, as the other answer didn’t work. FWIW, here’s what my com.apple.HIToolbox.plist file looks like after the changes: gist.github.com/anonymous/d18bae208b5cf12e48be Commented Nov 8, 2013 at 21:51
  • Worked flawlessly, thanks! I’m sorry I can’t give you the bounty any more, so I’ll just set up a new one just to reward you for this answer. Commented Nov 8, 2013 at 21:54
  • Worked like a charm. Great tip! Commented Jan 19, 2014 at 10:03
  • This is fantastic. I've been bogged down by my Belgian keyboard default to long! I wish i could give you multiple up votes! Commented Jan 21, 2014 at 13:21
  • 1
    Doesn't seem to work in Yosemite, has anyone else tried?
    – cortices
    Commented Feb 5, 2015 at 23:07

I found this old MacWorld tip, that suggested running the Setup Assistant again:

sudo /System/Library/CoreServices/Setup Assistant.app\
/Contents/MacOS/Setup Assistant

At first I thought this wasn’t supported in Lion anymore as running this command didn’t seem to have any effect. Only after posting this question, I noticed there’s a typo in the command. The space characters need to be escaped properly, or the location of the binary needs to be quoted. For this reason, the tip I linked to doesn’t work.

Here’s the correct command:

sudo "/System/Library/CoreServices/Setup Assistant.app/Contents/MacOS/Setup Assistant"

Alternatively, this would work as well:

sudo /System/Library/CoreServices/Setup\ Assistant.app/Contents/MacOS/Setup\ Assistant

Another gotcha that wasn’t mentioned on the page I linked to: the custom keyboard layout needs to be installed in /Library/Keyboard Layouts/ (i.e. cd /Library/Keyboard\ Layouts), not ~/Library/Keyboard Layouts, for it to appear in the Setup Assistant’s keyboard layout selection screen.

Update: As of OS X 10.8, you’ll need to run an extra command (i.e. remove a file first):

sudo rm /var/db/.AppleSetupDone; sudo "/System/Library/CoreServices/Setup Assistant.app/Contents/MacOS/Setup Assistant"

Also, you will have to create a new user account in order to complete the Setup Assistant — but don’t worry, you can delete the new account afterwards.

This trick doesn’t work anymore in recent OS X 10.8 versions.

Update: Here’s everything I know about custom keyboard layouts on OS X.

  • I followed your steps for the Mountain Lion 10.8 and ran the setup assistant gain set my default keyboard layout to Dvorak and tried to login but it did not work. on reboot it was still using qwerty for the login screen.
    – ams
    Commented Jan 5, 2013 at 22:01
  • Yeah, it doesn’t seem to work anymore since OS X 10.8. :( Commented Nov 1, 2013 at 22:21

I’m using a custom keyboard layout created with Ukelele in OS X 10.8.5. I changed the login screen keyboard layout with the following steps:

  1. Open Users & Groups in System Preferences
  2. Select Login Options from the bottom of the left panel
  3. Check Show Input menu in login window
  4. Go to login screen
  5. Select the preferred layout under Other input sources from the input menu, located at top right
  6. Go back and uncheck the Show Input menu in login window to prevent further changes to the login layout

I found this method far easier than editing some random .plist files and running commands it the Terminal.

This method might require administrative access, as you possibly have to unlock the right pane in step 3. above by clicking the lock icon at the bottom.

Update: Sadly, this doesn’t seem to work on OS X 10.9.

  • I’ve awarded you the bounty as this seemed like the best answer, but it doesn’t actually seem to work — it always goes back to the default US keyboard layout. To test this, I’ve used a keyboard layout that allows me to type three symbols with one keystroke, so that I can see how many masked characters appear in the password input box. After applying the steps you mentioned, I could only enter one symbol at a time (as per the US keyboard). Commented Nov 8, 2013 at 21:42
  • Can you describe what doesn't work with OS X 10.9? I am able to follow these steps (I didn't do step 6) successfully when using the Workman layout (found here: workman.deekayen.net). My problem however is that if that layout is selected and I lock the computer, the input menu won't show in the login screen, whereas it's fine if I have Dvorak or something else natively supported by OS X. (i.e. I see the menu and can switch back to U.S. if needed) Commented Nov 11, 2013 at 7:04
  • @TimothéeBoucher My previous comment describes what goes wrong, and how I tested this. Commented Nov 11, 2013 at 13:30

After installing macOS Sierra my custom layout was reinitialized back to the default each time after login in my account.

Apple added new keyboards and the ID was conflicting with the keyboard I was using.

To validate if you have this issue run:

sudo touch /Library/Keyboard\ Layouts/

The output:

Keyboard Layouts: duplicate keyboard layout identifier 5000.
Keyboard Layouts: keyboard layout identifier 5000 has been replaced with 16383.

The output claims it fixes something but it actually did not do anything. I still had to edit the layout myself and it started working like before.

  • Also got my custom one changed. Sadly, fixing IDs in the .plist files didn't help me. Commented Oct 4, 2016 at 21:43
  • @PavelGurkov did you run the sudo touch command on the folder after? It was required for the OS to consider it.
    – jrobichaud
    Commented Oct 4, 2016 at 22:09
  • Yeah, did that, got no output at all. Checked everything I could, but still... Worked flawlessly on El Capitan, no luck on Sierra. Commented Oct 5, 2016 at 10:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .