After installing .bundle, MacOS keep multiple duplicating Keyboard layouts

382 views
Skip to first unread message

TheNick Name

unread,
Dec 10, 2022, 10:27:14 PM12/10/22
to Ukelele Users
Hi guys, today I ran into a terrible bug, I downloaded some old custom keyboard out of the Internet, opened it for a bit and tried to make a bundle out of it, after I made it and moved it to the /Library /Keyboard Layouts folder, and I had a terrible bug,  I even removed all my bundles from the folder but nothing helps
45c9eff26c2dea2fb59f92ba31d1a915cf836d3279b56395ad3888d9ae751389.png

John Brownie

unread,
Dec 11, 2022, 2:09:16 AM12/11/22
to ukelel...@googlegroups.com
Have you tried restarting the computer? That should clear the cache of keyboard layouts.

John

Andrii Bakai

unread,
Jan 8, 2023, 1:41:10 PM1/8/23
to Ukelele Users
Restarting / Safe boot / Uninstalling bundle - nothing of that does not help

John Brownie

unread,
Jan 9, 2023, 1:28:07 AM1/9/23
to ukelel...@googlegroups.com
This is really strange now. Can you confirm that /Library/Keyboard Layouts has nothing in it, including hidden files? The same for ~/Library/Keyboard Layouts? Also check /System/Library/Keyboard Layouts, though that should be hard to change in current versions of macOS.

Once you have verified that there is nothing in the Keyboard Layouts folders, shut down and do a safe boot, then look at the Input Sources section of System Preferences to see what is there. A screen shot might help us see what is happening here.

John

Andrii Bakai

unread,
Jan 9, 2023, 7:56:41 AM1/9/23
to Ukelele Users
`/Library/Keyboard Layouts` - empty
`~/Library/Keyboard Layouts` - only my currently addde bundle (from Ukelele) (empty, if removed, but problem persists)
`/System/Library/Keyboard Layouts` - AppleKeyboardLayouts.bundle


CleanShot 2023-01-09 at 14.56.16@2x.png

John Brownie

unread,
Jan 9, 2023, 8:37:15 AM1/9/23
to ukelel...@googlegroups.com
What about the Input Sources? Can you show us a screenshot of that?

John

Andrii Bakai

unread,
Jan 9, 2023, 9:11:40 AM1/9/23
to Ukelele Users
After reboot:
CleanShot 2023-01-09 at 15.50.16@2x.png
After cleaning up
CleanShot 2023-01-09 at 15.48.56@2x.png
Cleanup process: (cannot add as attachment, file limit):

Andrii Bakai

unread,
Jan 9, 2023, 9:15:23 AM1/9/23
to Ukelele Users
If you want, we can communicate in Telegram/Gmail
Also if you need, I can test/try to debug

macOS: Ventura 13.1 (22C65)

John Brownie

unread,
Jan 10, 2023, 12:34:19 PM1/10/23
to ukelel...@googlegroups.com
OK, still looking like nothing I’ve ever seen! Can you confirm that the extra Ukrainian keyboard layouts reappear after a restart? Are they the Apple Ukrainian or a custom Ukrainian keyboard layout? Seeing that they have the new-type icons, I wonder if it’s the Apple one, but why that would be repeating is puzzling.

Sorry that I don’t have a lot of time this week, with lots of family things happening.

John

Tom

unread,
Jan 10, 2023, 12:54:34 PM1/10/23
to Ukelele Users

Andrii Bakai

unread,
Jan 10, 2023, 1:06:29 PM1/10/23
to Ukelele Users
Yes, extra Ukrainian keyboard layouts reapper after every restart.
They are - Apple Ukrainian (but strange, that they are duplicating)

Okay, it's not critical, because if deleted and do not change layout settings, layouts will not appear until restart

John Brownie

unread,
Jan 11, 2023, 2:37:44 AM1/11/23
to ukelel...@googlegroups.com
Can you show me the output of this Terminal command:

ls -laR /System/Library/Keyboard\ Layouts

It probably won’t show anything new, but I just want to rule out that the system’s keyboard layouts haven’t been corrupted. Basically, they should all show a modification date that is when you installed Ventura.

John

Andrii Bakai

unread,
Jan 11, 2023, 3:15:19 AM1/11/23
to Ukelele Users
Seems like every file modified at December 2
AKL.txt

John Brownie

unread,
Jan 11, 2023, 3:50:35 AM1/11/23
to ukelel...@googlegroups.com
OK, that is as it should be, so the problem has to lie somewhere in a settings file. I can’t get to that right now. We did look at them some time back without success, so maybe some sort of brute force search is required, e.g. searching for the string Ukrainian in all files and trying to see where it might turn up repeatedly.

On another tack, what was the original problematic keyboard layout? Looking at that might give me a clue as to what triggered the issue in the first place (perhaps a duplicate ID?).

John

Gé van Gasteren

unread,
Jan 11, 2023, 3:55:35 AM1/11/23
to ukelel...@googlegroups.com
Maybe this screenshot of one answer on the forum page Tom suggested can give some clue then:
Screenshot 2023-01-11 at 09.53.43.jpg


--
You received this message because you are subscribed to the Google Groups "Ukelele Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukelele-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ukelele-users/CAC13VMwb_uLQgJuZ0UGwiQugT0a81SJAdNmKwZrBLzwir-p%3DRg%40mail.gmail.com.

Andrii Bakai

unread,
Jan 11, 2023, 10:41:31 PM1/11/23
to Ukelele Users
Both layouts (English and Ukrainian) was "Capture Current Input Source" from "U.S." and "Ukrainian" (probably, Legacy, I don't remember exactly)

John Brownie

unread,
Jan 12, 2023, 7:35:29 AM1/12/23
to ukelel...@googlegroups.com
I wonder if the problem might have been having two keyboard layouts with the same name and the same id. Hopefully that shouldn’t happen any more. I might be able to test that theory in the coming few days. If it holds true, then I might be able to solve the resulting problem.

John 
--
John Brownie, john_b...@sil.org
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland

John Brownie

unread,
Jan 13, 2023, 8:22:16 AM1/13/23
to ukelel...@googlegroups.com
I tried to reproduce this in a virtual machine, without success. There are some weird things that go on with Ukrainian, though. For some reason, the keyboard layout has its name in the XML as Ukrainian-PC, but shows us as Ukrainian. Then, when I added the copy of Ukrainian with the same id, it was accepted, apparently enabled with a different id, but then doesn’t show up in the Input menu.

Digging into files containing the string “Ukrainian”, I found one that said that there should be four Ukrainian keyboard layouts, including both Ukrainian and Ukrainian-PC (as well as -Legacy and -QWERTY). But the only files that seemed to refer to keyboard layouts were /Library/Preferences/com.apple.HIToolbox.plist and ~/Library/Preferences/com.apple.inputsources.plist, so I’m none the wiser, I’m afraid!

The brute-force method for finding the string was to use the Find Any File app and search for file content containing “Ukrainian” and file name ending with “plist”. It shows up way more occurrences on my live system than on the VM I tried, which was all but unchanged from the defaults as installed.

John

Sorin Paliga

unread,
Jan 13, 2023, 8:51:32 AM1/13/23
to ukelel...@googlegroups.com
Hello John

Not directly connected to this issue: the keyboard layouts have never been a strong point of macOS, even if, beginning with 10.2, it has been quite easy to add custom ones. I could not test all the keylayouts, but—as a mere example—the Extended U.S. keylayout (now renamed ABC Extended) has impossible non-mnemonic Option combinations. I solved them with my US Academic. To say nothing of the basic U.S. keylayout, with its eerie chars at the Option level. This is entirely bizarre, because the initial solution was very good, i.e. the basic Option combinations for acute, grave, umlaut, cedilla and circumflex.
For many years, users of Hungarian and Romanian keylayouts could not access one essential char if using a U.S. physical keyboard, only with the European ISO extended keyboards. Meanwhile, there is a solution for Romanian, I do not know whether for Hungarian as well (have not tested this, but it was a discussion on this forum several years ago). This is why that banal extra key left to Z is very useful in Europe. Nevertheless, many people buy macs in U.S. or elsewhere with the U.S. physical keyboard. The discussion may be longer, but I stop here.
In this context, I do not wonder that the Ukrainian keylayouts may be problematic, it would not be the only case with Apple keylayouts. Of course, I repeated sent them feedbacks on this issue, then I stopped: it was entirely useless, they do not care. Nevertheless, in this very case, I suspect he did something illegal with the system, I cannot figure out what, so the reported problem is not exactly an Apple issue. 
Anyway: I think macOS has a (much) better solution for the custom keylayouts than Windows, to say nothing of Linux, at least from the simple reason that UKELELE may add new functionalities. Also, macOS allows a simple solution to add these keylayouts to the basic set. 
Unfortunately, things are a lot worse (Windows or Linux style) with iPad OS, in fact iOS running on a larger screen. 

Best from Bucharest

--
You received this message because you are subscribed to the Google Groups "Ukelele Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukelele-user...@googlegroups.com.

Sorin Paliga

unread,
Jan 13, 2023, 9:19:05 AM1/13/23
to ukelel...@googlegroups.com
Corrigenda: ... I repeatedly sent them feedbacks instead of "I repeated …” 
I always am in a terrible hurry. 

Andrii Bakai

unread,
Jan 16, 2023, 4:22:21 AM1/16/23
to Ukelele Users
Hmm, ~/Library/Preferences/com.apple.inputsources.plist is strange...
The first two is unknown, the last two - current bundle
In one hour I'll try to delete this and reboot

CleanShot 2023-01-16 at 11.20.00@2x.png

Andrii Bakai

unread,
Jan 16, 2023, 5:26:48 AM1/16/23
to Ukelele Users
I cannot nor remove, nor edit this file even with sudo...

John Brownie

unread,
Jan 16, 2023, 6:41:13 AM1/16/23
to ukelel...@googlegroups.com
On 16 Jan 2023 at 12:26:48, Andrii Bakai <andruha....@gmail.com> wrote:
I cannot nor remove, nor edit this file even with sudo…

Can you log in with a different account and try to delete the file?

John

Andrii Bakai

unread,
Jan 16, 2023, 6:50:12 AM1/16/23
to Ukelele Users
I don't have another  accounts, also permissions on file is for mine account
But cannot remove/edit even with sudo (chmod)

CleanShot 2023-01-16 at 13.45.03@2x.png

Do I have to create new user (will it help with same sudo root user?)

Or maybe try to disable some sort of SIP, etc?

Andrii Bakai

unread,
Jan 16, 2023, 7:03:35 AM1/16/23
to Ukelele Users
Created new Administrator user - same behavior, cannot remove/edit file even with sudo

John Brownie

unread,
Jan 16, 2023, 7:08:13 AM1/16/23
to ukelel...@googlegroups.com
I was thinking of creating a new account and seeing if it could be deleted while the normal account was logged out. However, in my testing, that doesn’t work either. There’s an extended attribute on the file which can’t be deleted. I’ll have to do some research on that one.

John

Andrii Bakai

unread,
Jan 16, 2023, 7:10:14 AM1/16/23
to Ukelele Users
What about disabling SIP (System Integrity Protection)?

John Brownie

unread,
Jan 16, 2023, 7:15:16 AM1/16/23
to ukelel...@googlegroups.com
I don’t think it’s related to SIP, as it’s not in one of the system’s folders.

From a brief search, I turned up several people asking about the com.apple.provenance extended attribute, which seems to have appeared in Ventura and has no available information about it.

I did not have the attribute on my copy of the file (in my normal account, not the new VM) and was able to delete it, but that may be because it was inherited from an earlier version of macOS.

A long shot would be trying to boot the computer from an external disk running an earlier version of macOS (probably Monterey would work) and deleting it that way. Not easy, but it might work.

I’ll do some more research.

John

John Brownie

unread,
Jan 18, 2023, 7:06:00 AM1/18/23
to ukelel...@googlegroups.com
I’m not getting any answer to my question on the Apple Developers Forums, so I suspect that nobody outside Apple knows what is going on, and those inside Apple can’t or won’t answer publicly. It may require using a developer incident to find out, which I can’t do for a couple of weeks or so.

In the meantime, perhaps you could run the following command:
xattr -px com.apple.provenance com.apple.inputsources.plist
from the ~/Library/Preferences folder. On my test VM, this is what it outputs:
01 00 00 19 4E E6 55 46 0C 85 DA
It would be interesting to see if yours has the same. On my regular machine, I deleted the file, and it has not reappeared, so it is all getting rather confusing!

John

Andrii Bakai

unread,
Jan 18, 2023, 2:20:52 PM1/18/23
to Ukelele Users
No such xattr: com.apple.provenance...

CleanShot 2023-01-18 at 21.19.30@2x.png

John Brownie

unread,
Jan 19, 2023, 2:16:10 AM1/19/23
to ukelel...@googlegroups.com
Interesting. How about running this command, then:

xattr -lx com.apple.inputsources.plist

I am assuming that there is some extended attribute which makes the file impossible to remove. On mine, it was the com.apple.provenance attribute, so I was assuming the same for yours.

John

Andrii Bakai

unread,
Jan 19, 2023, 4:21:01 AM1/19/23
to Ukelele Users
com.apple.lastuseddate#PS
com.apple.macl
CleanShot 2023-01-19 at 11.20.15@2x.png

John Brownie

unread,
Jan 19, 2023, 7:37:00 AM1/19/23
to ukelel...@googlegroups.com
OK, a bit more research seems to imply that SIP may indeed be the mechanism that prevents the deletion. So, if you’re comfortable doing it, you could try disabling SIP, removing that file (or moving it somewhere else), then re-enabling SIP and booting as normal. I won’t put instructions for enabling/disabling SIP here, since they are readily discoverable, but I don’t want people to think of this as a “simple” fix.

An alternative to this might be booting from an external disk, since SIP only applies to the boot volume.

John

Andrii Bakai

unread,
Jan 20, 2023, 3:04:51 AM1/20/23
to Ukelele Users
Yes, when disabled SIP, I can remove both HIToolbox and inputsources files and after reboot everything is fine with layouts

Tried to reproduce bug with multiple layouts - it happens when messing with HIToolbox file, but can be fixed only with deleting both files

John Brownie

unread,
Jan 20, 2023, 4:50:15 AM1/20/23
to ukelel...@googlegroups.com
Glad to get a result after everything we tried!

John

william sjöden

unread,
Jun 12, 2023, 2:57:33 PM6/12/23
to Ukelele Users
Were you able to edit/add any other keyboard layouts?
Im kinda in the same situation at the moment.
I installed a custom layout that i wanted to edit. But I cannot even import a new layout. Every time i do it just duplicates the first one. Not really feeling like trying to disable SIP to remove this.

Daniel Hinostroza

unread,
Jun 24, 2023, 11:35:34 AM6/24/23
to Ukelele Users
Hi,
In my case, it turned out to be the id on the .keylayout. My keylayout ids were both id="-2". If you change them to lower numbers (e.g. id="-33000") and restart, it'll fix the issue.
Screenshot 2023-06-24 at 10.26.48.png

Reply all
Reply to author
Forward
0 new messages