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 1
1
CFBundleName = "Fcitx5";
2
2
CFBundleDisplayName = "Fcitx5";
3
3
org.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"
23
23
su -m " $user " -c " ./switch_im com.apple.keylayout.ABC"
24
24
su -m " $user " -c " ./switch_im com.apple.keylayout.US"
25
25
killall 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.
26
49
su -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 1
1
CFBundleName = "小企鹅";
2
2
CFBundleDisplayName = "小企鹅";
3
3
org.fcitx.inputmethod.fcitx5 = "小企鹅";
4
+ org.fcitx.inputmethod.zhHans = "小企鹅";
Original file line number Diff line number Diff line change 1
1
CFBundleName = "小企鵝";
2
2
CFBundleDisplayName = "小企鵝";
3
3
org.fcitx.inputmethod.fcitx5 = "小企鵝";
4
+ org.fcitx.inputmethod.zhHans = "小企鵝";
Original file line number Diff line number Diff line change 33
33
<dict >
34
34
<key >org.fcitx.inputmethod.fcitx5</key >
35
35
<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 >
36
49
<key >tsInputModeMenuIconFileKey</key >
37
50
<string >menu_icon.pdf</string >
38
51
<key >tsInputModeAlternateMenuIconFileKey</key >
You can’t perform that action at this time.
0 commit comments