File tree Expand file tree Collapse file tree 5 files changed +40
-0
lines changed Expand file tree Collapse file tree 5 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 11CFBundleName = "Fcitx5";
22CFBundleDisplayName = "Fcitx5";
33org.fcitx.inputmethod.fcitx5 = "Fcitx5";
4+ org.fcitx.inputmethod.zhHans = "Fcitx5";
Original file line number Diff line number Diff line change @@ -23,4 +23,28 @@ cd "$RESOURCES_DIR"
2323su -m " $user " -c " ./switch_im com.apple.keylayout.ABC"
2424su -m " $user " -c " ./switch_im com.apple.keylayout.US"
2525killall Fcitx5
26+
27+ # This input source ID comes from Carbon API:
28+ # import Carbon
29+
30+ # let bundleId = "org.fcitx.inputmethod.Fcitx5"
31+ # let conditions = NSMutableDictionary()
32+ # conditions.setValue(bundleId, forKey: kTISPropertyBundleID as String)
33+ # if let array = TISCreateInputSourceList(conditions, true)?.takeRetainedValue()
34+ # as? [TISInputSource]
35+ # {
36+ # for inputSource in array {
37+ # if let ptr = TISGetInputSourceProperty(inputSource, kTISPropertyInputSourceID) {
38+ # let inputSourceID = Unmanaged<CFString>.fromOpaque(ptr).takeUnretainedValue() as String
39+ # print(inputSourceID)
40+ # }
41+ # }
42+ # }
43+
44+ # The rule to construct seems:
45+ # org.fcitx.inputmethod.Fcitx5 is our CFBundleIdentifier;
46+ # The rest is the keys under tsInputModeListKey trimming the org.fcitx.inputmethod.
47+
48+ # Not sure which one so try both.
2649su -m " $user " -c " ./switch_im org.fcitx.inputmethod.Fcitx5.fcitx5"
50+ su -m " $user " -c " ./switch_im org.fcitx.inputmethod.Fcitx5.zhHans"
Original file line number Diff line number Diff line change 11CFBundleName = "小企鹅";
22CFBundleDisplayName = "小企鹅";
33org.fcitx.inputmethod.fcitx5 = "小企鹅";
4+ org.fcitx.inputmethod.zhHans = "小企鹅";
Original file line number Diff line number Diff line change 11CFBundleName = "小企鵝";
22CFBundleDisplayName = "小企鵝";
33org.fcitx.inputmethod.fcitx5 = "小企鵝";
4+ org.fcitx.inputmethod.zhHans = "小企鵝";
Original file line number Diff line number Diff line change 3333 <dict >
3434 <key >org.fcitx.inputmethod.fcitx5</key >
3535 <dict >
36+ <!-- register as English to enable on browser password field/Terminal sudo password input -->
37+ <key >tsInputModeMenuIconFileKey</key >
38+ <string >menu_icon.pdf</string >
39+ <key >tsInputModeAlternateMenuIconFileKey</key >
40+ <string >menu_icon.pdf</string >
41+ <key >tsInputModePaletteIconFileKey</key >
42+ <string >menu_icon.pdf</string >
43+ </dict >
44+ <key >org.fcitx.inputmethod.zhHans</key >
45+ <dict >
46+ <!-- register as Chinese to disable on browser password field/Terminal sudo password input -->
47+ <key >TISIntendedLanguage</key >
48+ <string >zh-Hans</string >
3649 <key >tsInputModeMenuIconFileKey</key >
3750 <string >menu_icon.pdf</string >
3851 <key >tsInputModeAlternateMenuIconFileKey</key >
You can’t perform that action at this time.
0 commit comments