Reloading altered keyboard layout
When using Ukulele, how can I get an altered keyboard layout in ~/Library/Keyboard\ Layouts
to be reloaded without rebooting?
According to a thread in the Ukelele group, changing the key layout ID before installing can cause OS X to load the new layout. This should be done on a working copy of the layout bundle, not an installed one, and may not work in newer versions of OS X (I could not get it to work under High Sierra). If changing the ID doesn't work for you, logging out and back in again should reload keyboard layouts.
Steps:
- Open a working copy of the layout bundle in Ukelele. Note this can't be an installed, active layout (i.e. one in a relevant "Library/Keyboard Layouts" folder).
- Generate a new ID:
- In Ukelele's list of keyboard layouts for the bundle, right-click the layout and choose "Set Keyboard Name and Script…".
- Change the script (e.g. from "Unicode" to "Roman"), taking note of the original value.
- Click OK
- Repeat the last 3 steps and change the script back to the original value.
- Save the layout.
- If an older copy of the layout is installed, remove it from the relevant "Keyboard Layout" folder.
- Copy the updated layout to the relevant "Keyboard Layout" folder.
Under the hood, this changes the "id" attribute of the root <keyboard>
element in Contents/Resources/<name>.layout
within the bundle.