From fd1aee42d24119f57b33225a9438a80c9c2758b0 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 5 Sep 2022 14:38:53 +0800 Subject: [PATCH] Main // Dynamically get connection name from info.plist file. --- Source/Modules/main.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Modules/main.swift b/Source/Modules/main.swift index aa44f436..59d2a28c 100644 --- a/Source/Modules/main.swift +++ b/Source/Modules/main.swift @@ -11,7 +11,11 @@ import Cocoa import InputMethodKit -let kConnectionName = "org.atelierInmu.inputmethod.vChewing_Connection" +guard let kConnectionName = Bundle.main.infoDictionary?["InputMethodConnectionName"] as? String +else { + NSLog("Fatal error: Failed from retrieving connection name from info.plist file.") + exit(-1) +} switch max(CommandLine.arguments.count - 1, 0) { case 0: break