From 85037c3d8fa3d9efd2fb3dd796174092052e1b6b Mon Sep 17 00:00:00 2001 From: MapoMagpie Date: Mon, 12 Feb 2024 01:03:21 +0800 Subject: [PATCH] change: depoly command and rime user dir in macos; --- core/options.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/options.go b/core/options.go index 64d8013..ee81816 100755 --- a/core/options.go +++ b/core/options.go @@ -163,9 +163,13 @@ func osRimeDefaultValue() (dictPath, restartRimeCmd string) { defaultSchema := findRimeDefaultSchema(filepath.Join(configDir, "rime", "default.custom.yaml")) dictPath = filepath.Join(configDir, "Rime", defaultSchema+".dict.yaml") case "dwain": - restartRimeCmd = "" // i dont know - defaultSchema := findRimeDefaultSchema(filepath.Join(configDir, "rime", "default.custom.yaml")) - dictPath = filepath.Join(configDir, "rime", defaultSchema+".dict.yaml") + homeDir, err := os.UserHomeDir() + if err != nil { + return "", "" + } + restartRimeCmd = "\"/Library/Input Methods/Squirrel.app/Contents/MacOS/Squirrel\" --reload" // mabye + defaultSchema := findRimeDefaultSchema(filepath.Join(homeDir, "Library", "Rime", "default.custom.yaml")) + dictPath = filepath.Join(homeDir, "Library", "Rime", defaultSchema+".dict.yaml") default: restartRimeCmd = "dbus-send --session --print-reply --dest=org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.SetConfig string:'fcitx://config/addon/rime' variant:string:''" defaultSchema := findRimeDefaultSchema("$HOME/.local/share/fcitx5/rime/default.custom.yaml")