Last active
June 27, 2023 02:37
-
-
Save maboloshi/5cda4be7e6fac61a1cfa2c7a66375f16 to your computer and use it in GitHub Desktop.
[mac 删除默认ABC输入法] mac默认ABC输入法,默认无法使用“系统偏好与设置”中删除。需要运行本脚本,运行后立即重启系统。生效修改
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd ~/Library/Preferences/ | |
cp com.apple.HIToolbox.plist com.apple.HIToolbox.plist.bak | |
alias plistbuddy='/usr/libexec/PlistBuddy' | |
dict=$(plistbuddy -c "Print AppleEnabledInputSources" com.apple.HIToolbox.plist| grep -c "Dict") | |
for i in {0..$dict};do | |
if [ "$(plistbuddy -c "Print AppleEnabledInputSources:$i:KeyboardLayout\ Name" com.apple.HIToolbox.plist 2>/dev/null)" = "ABC" ] | |
then | |
plistbuddy -c "Delete :AppleEnabledInputSources:$i" com.apple.HIToolbox.plist; | |
return; | |
fi | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
``与#( )同效