Mark24 2 vuotta sitten
vanhempi
sitoutus
d13693df12
4 muutettua tiedostoa jossa 291 lisäystä ja 1 poistoa
  1. 15 1
      README.md
  2. 27 0
      default.custom.yaml
  3. 38 0
      deploy.rb
  4. 211 0
      squirrel.custom.yaml

+ 15 - 1
README.md

@@ -1 +1,15 @@
-# auto-deploy-rime
+# Rime auto deploy
+
+仅在MacOS下测试
+
+# 自动部署内容:
+
+## step1: 确认安装 Rime 输入法,自动安装
+
+需要用户自行登出,重进系统,设置Rime输入法为系统输入法
+
+## step2: 备份 Rime 默认配置
+
+## step3: 自动安装 Rime-ice 配置
+
+## step4: 自动追加自定义配置模板

+ 27 - 0
default.custom.yaml

@@ -0,0 +1,27 @@
+patch:
+  # 菜单
+  menu:
+    page_size: 8  # 候选词个数
+    # alternative_select_labels: [ ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, ⑨, ⑩ ]  # 修改候选项标签
+    # alternative_select_keys: ASDFGHJKL  # 如编码字符占用数字键,则需另设选字键
+    # ascii_mode、inline、no_inline、vim_mode 等等设定,可参考 /Library/Input Methods/Squirrel.app/Contents/SharedSupport/squirrel.yaml
+  # 中西文切换
+  #
+  # 【good_old_caps_lock】 CapsLock 切换到大写或切换中英。
+  # (macOS 偏好设置的优先级更高,如果勾选【使用大写锁定键切换“ABC”输入法】则始终会切换输入法)
+  #
+  # 切换中英:
+  # 不同的选项表示:打字打到一半时按下了 CapsLock、Shift、Control 后: 
+  # commit_code  上屏原始的编码,然后切换到英文
+  # commit_text  上屏拼出的词句,然后切换到英文
+  # clear        清除未上屏内容,然后切换到英文
+  # inline_ascii 无输入时,切换中英;有输入时,切换到临时英文模式,按回车上屏后回到中文状态
+  # noop         屏蔽快捷键,不切换中英,但不要屏蔽 CapsLock
+  ascii_composer:
+    good_old_caps_lock: true  # true | false
+    switch_key:
+      Caps_Lock: clear  # commit_code | commit_text | clear
+      Shift_L: clear     # commit_code | commit_text | inline_ascii | clear | noop
+      Shift_R: clear     # commit_code | commit_text | inline_ascii | clear | noop
+      Control_L: noop   # commit_code | commit_text | inline_ascii | clear | noop
+      Control_R: noop   # commit_code | commit_text | inline_ascii | clear | noop

+ 38 - 0
deploy.rb

@@ -0,0 +1,38 @@
+#!/usr/bin/env ruby
+
+puts "==== Rime auto deploy ===="
+puts "Have you installed Rime?(y/n)"
+
+result = gets
+if result.strip != "y"
+  puts "(1/4) Install rime ? (y/n)"
+  result = gets
+  system("brew install --cask squirrel") if result.strip == "y"
+  puts "step1: Logout and relogin system"
+  puts "step2: Make Rime Input as your input method in system pane."
+  puts "step3: Rerun this program, jump over install Rime step."
+else
+  puts "Do you want to continue?(y/n)"
+  result = gets
+  exit 0 if result.strip != "y"
+
+  puts "(2/4) Backup Rime default config."
+  puts "run `mv ~/Library/Rime ~/Library/Rime.old`"
+  system("mv ~/Library/Rime ~/Library/Rime.old")
+  puts "done ✅"
+  puts ""
+  puts "(3/4) Install Rime-ice config."
+  puts "run `git clone --depth=1 https://github.com/Mark24Code/rime-ice.git ~/Library/Rime`"
+  system(
+    "git clone --depth=1 https://github.com/Mark24Code/rime-ice.git ~/Library/Rime"
+  )
+  puts "done ✅"
+  puts ""
+  puts "(4/4) Download Custom config."
+  system("cp ./default.custom.yaml ~/Library/Rime/")
+  system("cp ./squirrel.custom.yaml ~/Library/Rime/")
+  puts "done ✅"
+  puts ""
+  puts "Deploy finised"
+  puts "Please open Rime setting pane and click `redeploy`. Enjoy~ 🍻"
+end

+ 211 - 0
squirrel.custom.yaml

@@ -0,0 +1,211 @@
+patch:
+  # ascii_mode、inline、no_inline、vim_mode 等等设定,可参考 /Library/Input Methods/Squirrel.app/Contents/SharedSupport/squirrel.yaml
+  app_options:
+    #com.raycast.macos:
+    #  ascii_mode: true   # 初始爲西文模式
+    #com.microsoft.VSCode:
+    #  ascii_mode: true   # 初始爲西文模式
+    #  vim_mode: true
+    #md.obsidian:
+    #  ascii_mode: true   # 初始爲西文模式
+    #  vim_mode: true
+    #org.alacritty:
+    #  ascii_mode: true   # 初始爲西文模式
+    #com.jetbrains.intellij:
+    #  ascii_mode: true
+    #  vim_mode: true
+  
+  style:
+    # 选择皮肤,亮色与暗色主题
+    # color_scheme: purity_of_form_custom
+    # color_scheme_dark: purity_of_form_custom
+    # color_scheme: macos_light
+    # color_scheme_dark: macos_dark
+    color_scheme: wechat_light
+    color_scheme_dark: wechat_dark
+  
+    # 预设选项:(可被皮肤覆盖;如果皮肤没写,则默认使用这些属性。)
+    text_orientation: horizontal  # horizontal | vertical
+    inline_preedit: true
+    corner_radius: 10
+    hilited_corner_radius: 0
+    border_height: 0
+    border_width: 0
+    line_spacing: 5
+    spacing: 10
+    #candidate_format: '%c. %@'
+    #base_offset: 6
+    font_face: 'Lucida Grande'
+    font_point: 21
+    #label_font_face: 'Lucida Grande'
+    label_font_point: 18
+    #comment_font_face: 'Lucida Grande'
+    comment_font_point: 18
+  
+  # 皮肤列表
+  preset_color_schemes:
+    macos_light:
+      name: "MacOS 浅色/MacOS Light"
+      author: 小码哥
+      font_face: "PingFangSC"          # 字体及大小
+      font_point: 21
+      label_font_face: "PingFangSC"    # 序号字体及大小
+      label_font_point: 12
+      comment_font_face: "PingFangSC"  # 注字体及大小
+      comment_font_point: 21
+      candidate_format: "%c\u2005%@\u2005" # 编号 %c 和候选词 %@ 前后的空间
+      candidate_list_layout: linear   # 候选排布:层叠 stacked | 行 linear
+      text_orientation: horizontal    # 行文向: 横 horizontal | 纵 vertical
+      inline_preedit: true            # 拼音位于: 候选框 false | 行内 true
+      translucency: false             # 磨砂: false | true
+      mutual_exclusive: false         # 色不叠加: false | true
+      border_height: 1                # 外边框 高
+      border_width: 1                 # 外边框 宽
+      corner_radius: 5                # 外边框 圆角半径
+      hilited_corner_radius: 5       # 选中框 圆角半径
+      surrounding_extra_expansion: 0 # 候选项背景相对大小?
+      shadow_size: 0                 # 阴影大小
+      line_spacing: 5                # 行间距
+      base_offset: 0                 # 字基高
+      alpha: 1                       # 透明度,0~1
+      spacing: 10                    # 拼音与候选项之间的距离 (inline_preedit: false)
+      color_space: srgb                       # 色彩空间: srgb | display_p3
+      back_color: 0xFFFFFF                    # 底色
+      hilited_candidate_back_color: 0xD75A00  # 选中底色
+      label_color: 0x999999                   # 序号颜色
+      hilited_candidate_label_color: 0xFFFFFF # 选中序号颜色
+      candidate_text_color: 0x3c3c3c          # 文字颜色
+      hilited_candidate_text_color: 0xFFFFFF  # 选中文字颜色
+      comment_text_color: 0x999999            # 注颜色
+      hilited_comment_text_color: 0xFFFFFF    # 选中注颜色
+      text_color: 0x424242                    # 拼音颜色 (inline_preedit: false)
+      hilited_text_color: 0xFFFFFF            # 选中拼音颜色 (inline_preedit: false)
+      candidate_back_color: 0xe9e9ea          # 候选项底色
+      # preedit_back_color:                   # 拼音底色 (inline_preedit: false)
+      hilited_back_color: 0xD75A00            # 选中拼音底色 (inline_preedit: false)
+      border_color: 0xFFFFFF                  # 外边框颜色
+  
+    macos_dark:
+      name: "MacOS 深色/MacOS Dark"
+      author: 小码哥
+      font_face: "PingFangSC"          # 字体及大小
+      font_point: 21
+      label_font_face: "PingFangSC"    # 序号字体及大小
+      label_font_point: 12
+      comment_font_face: "PingFangSC"  # 注字体及大小
+      comment_font_point: 21
+      candidate_format: "%c\u2005%@\u2005" # 编号 %c 和候选词 %@ 前后的空间
+      candidate_list_layout: linear   # 候选排布:层叠 stacked | 行 linear
+      text_orientation: horizontal    # 行文向: 横 horizontal | 纵 vertical
+      inline_preedit: true            # 拼音位于: 候选框 false | 行内 true
+      translucency: false             # 磨砂: false | true
+      mutual_exclusive: false         # 色不叠加: false | true
+      border_height: 1                # 外边框 高
+      border_width: 1                 # 外边框 宽
+      corner_radius: 5                # 外边框 圆角半径
+      hilited_corner_radius: 5       # 选中框 圆角半径
+      surrounding_extra_expansion: 0 # 候选项背景相对大小?
+      shadow_size: 0                 # 阴影大小
+      line_spacing: 5                # 行间距
+      base_offset: 0                 # 字基高
+      alpha: 1                       # 透明度,0~1
+      spacing: 10                    # 拼音与候选项之间的距离 (inline_preedit: false)
+      color_space: srgb                       # 色彩空间: srgb | display_p3
+      back_color: 0x1f1e2d                  # 底色
+      hilited_candidate_back_color: 0xD75A00  # 选中底色
+      label_color: 0x999999                   # 序号颜色
+      hilited_candidate_label_color: 0xFFFFFF # 选中序号颜色
+      candidate_text_color: 0xe9e9ea          # 文字颜色
+      hilited_candidate_text_color: 0xFFFFFF  # 选中文字颜色
+      comment_text_color: 0x999999            # 注颜色
+      hilited_comment_text_color: 0x999999    # 选中注颜色
+      text_color: 0x808080                    # 拼音颜色 (inline_preedit: false)
+      hilited_text_color: 0xFFFFFF            # 选中拼音颜色 (inline_preedit: false)
+      candidate_back_color: 0xe9e9ea          # 候选项底色
+      # preedit_back_color:                   # 拼音底色 (inline_preedit: false)
+      hilited_back_color: 0xD75A00            # 选中拼音底色 (inline_preedit: false)
+      border_color: 0x050505                  # 外边框颜色
+  
+    wechat_light:
+      name: "微信浅色/Wechat Light"
+      author: 小码哥
+      font_face: "PingFangSC"          # 字体及大小
+      font_point: 21
+      label_font_face: "PingFangSC"    # 序号字体及大小
+      label_font_point: 13
+      comment_font_face: "PingFangSC"  # 注字体及大小
+      comment_font_point: 21
+      candidate_format: "%c\u2005%@\u2005" # 编号 %c 和候选词 %@ 前后的空间
+      candidate_list_layout: linear   # 候选排布:层叠 stacked | 行 linear
+      text_orientation: horizontal    # 行文向: 横 horizontal | 纵 vertical
+      inline_preedit: true            # 拼音位于: 候选框 false | 行内 true
+      translucency: false             # 磨砂: false | true
+      mutual_exclusive: false         # 色不叠加: false | true
+      border_height: 1                # 外边框 高
+      border_width: 1                 # 外边框 宽
+      corner_radius: 5                # 外边框 圆角半径
+      hilited_corner_radius: 5       # 选中框 圆角半径
+      surrounding_extra_expansion: 0 # 候选项背景相对大小?
+      shadow_size: 0                 # 阴影大小
+      line_spacing: 5                # 行间距
+      base_offset: 0                 # 字基高
+      alpha: 1                       # 透明度,0~1
+      spacing: 10                    # 拼音与候选项之间的距离 (inline_preedit: false)
+      color_space: srgb                       # 色彩空间: srgb | display_p3
+      back_color: 0xFFFFFF                    # 底色
+      hilited_candidate_back_color: 0x79af22  # 选中底色
+      label_color: 0x999999                   # 序号颜色
+      hilited_candidate_label_color: 0xFFFFFF # 选中序号颜色
+      candidate_text_color: 0x3c3c3c          # 文字颜色
+      hilited_candidate_text_color: 0xFFFFFF  # 选中文字颜色
+      comment_text_color: 0x999999            # 注颜色
+      hilited_comment_text_color: 0x999999    # 选中注颜色
+      text_color: 0x424242                    # 拼音颜色 (inline_preedit: false)
+      hilited_text_color: 0x999999            # 选中拼音颜色 (inline_preedit: false)
+      candidate_back_color: 0xe9e9ea          # 候选项底色
+      # preedit_back_color:                   # 拼音底色 (inline_preedit: false)
+      hilited_back_color: 0x79af22            # 选中拼音底色 (inline_preedit: false)
+      border_color: 0xFFFFFF                  # 外边框颜色
+  
+    wechat_dark:
+      name: "微信深色/Wechat Dark"
+      author: 小码哥
+      font_face: "PingFangSC"          # 字体及大小
+      font_point: 21
+      label_font_face: "PingFangSC"    # 序号字体及大小
+      label_font_point: 13
+      comment_font_face: "PingFangSC"  # 注字体及大小
+      comment_font_point: 21
+      candidate_format: "%c\u2005%@\u2005" # 编号 %c 和候选词 %@ 前后的空间
+      candidate_list_layout: linear   # 候选排布:层叠 stacked | 行 linear
+      text_orientation: horizontal    # 行文向: 横 horizontal | 纵 vertical
+      inline_preedit: true            # 拼音位于: 候选框 false | 行内 true
+      translucency: false             # 磨砂: false | true
+      mutual_exclusive: false         # 色不叠加: false | true
+      border_height: 1                # 外边框 高
+      border_width: 1                 # 外边框 宽
+      corner_radius: 5                # 外边框 圆角半径
+      hilited_corner_radius: 5       # 选中框 圆角半径
+      surrounding_extra_expansion: 0 # 候选项背景相对大小?
+      shadow_size: 0                 # 阴影大小
+      line_spacing: 5                # 行间距
+      base_offset: 0                 # 字基高
+      alpha: 1                       # 透明度,0~1
+      spacing: 10                    # 拼音与候选项之间的距离 (inline_preedit: false)
+      color_space: srgb                       # 色彩空间: srgb | display_p3
+      back_color: 0x151515                    # 底色
+      hilited_candidate_back_color: 0x79af22  # 选中底色
+      label_color: 0x999999                   # 序号颜色
+      hilited_candidate_label_color: 0xFFFFFF # 选中序号颜色
+      candidate_text_color: 0xbbbbbb          # 文字颜色
+      hilited_candidate_text_color: 0xFFFFFF  # 选中文字颜色
+      comment_text_color: 0x999999            # 注颜色
+      hilited_comment_text_color: 0xFFFFFF    # 选中注颜色
+      text_color: 0xbbbbbb                    # 拼音颜色 (inline_preedit: false)
+      hilited_text_color: 0x999999            # 选中拼音颜色 (inline_preedit: false)
+      candidate_back_color: 0xbbbbbb          # 候选项底色
+      # preedit_back_color:                   # 拼音底色 (inline_preedit: false)
+      hilited_back_color: 0x79af22            # 选中拼音底色 (inline_preedit: false)
+      border_color: 0x292929                  # 外边框颜色
+    
+