Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Ukelele's developer (John Brownie) on the website:

Second, if you have a keyboard layout that is active, modify it (in Ukelele or any other way), save it, then log out and log in again, the system will not load the new version. You need to modify the folder that contains the keyboard layout to get the system to recognise the change. The easiest way is to drag the keyboard layout file to the desktop and then back to the Keyboard Layouts folder, then log out and log in again. Restarting will always load the newest version of a keyboard layout.

Any more sane method?


So it seems that most likely no. Here's a way to partially automate it with Applescript though:


do shell script "touch '/Library/Keyboard Layouts/'"
tell application "System Events"
    try
        tell process "Ukelele"
            click menu bar 1's menu bar item "File"'s menu 1's menu item "Save"
        end tell
    end try
    log out
end tell
share|improve this question

1 Answer 1

up vote 0 down vote accepted

Sorry, but there's not much better than can be done. Keyboard layouts are only scanned at login, and if you don't restart, then the system optimises the process by only scanning folders that have changed since the last login, by checking the modification date of the folder.

About the only other way I can think of to automate that is to have a script that changes the modification date of the relevant folder - a shell script calling 'touch' would work (see below). Then you could have a simpler way of making the change (rather than dragging files out and in), but you would still have to log out and log in. I don't know of a shortcut to logging out, apart from hitting option-shift-command-Q. I have not seen a way to script it.

Script to change the modification date of the Keyboard Layouts folder in the Library folder:

#!/bin/sh
touch /Library/Keyboard\ Layouts
share|improve this answer
    
Thanks, that's what I was expecting to hear actually. One way to log out is tell app "System Events" to log out. –  ؘؘؘؘ Apr 9 '11 at 11:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.