cjxd

cjxd

长恨此身非我有,何时忘却营营

Mouse Whisker Tube | Rime Pinyin Configuration

An input method on Mac that you can't go back to after using it, along with custom configurations

Download#

brew install --cask squirrel

After installation, you may need to log out of the current session before you can find it in the system input method configuration.

Add Input Method in Settings#

In the keyboard section of settings, press the plus sign to add the Squirrel input method.

Configuration#

  • Backup the built-in configuration
cd $HOME/Library
mv Rime Rime.old
  • Download Wusong Pinyin configuration
git clone --depth=1 https://github.com/iDvel/rime-ice.git Rime

Click Settings to open the configuration directory, download squirrel.custom.yaml and default.custom.yaml from Gist https://gist.github.com/lewangdev/f8ebbba24f464e915fb7d36857fcbbe5 to the configuration directory, and then click Deploy to finish the configuration.

patch:
  # Menu
  menu:
    page_size: 8  # Number of candidate words
    # alternative_select_labels: [ ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, ⑨, ⑩ ]  # Modify candidate option labels
    # alternative_select_keys: ASDFGHJKL  # If encoding characters occupy number keys, alternative selection keys need to be set
    # ascii_mode, inline, no_inline, vim_mode, etc. settings can refer to /Library/Input Methods/Squirrel.app/Contents/SharedSupport/squirrel.yaml
  # Switching between Chinese and English
  #
  # 【good_old_caps_lock】 CapsLock switches to uppercase or switches between Chinese and English.
  # (macOS preferences take precedence, if "Use Caps Lock to switch 'ABC' input method" is checked, it will always switch input methods)
  #
  # Switching between Chinese and English:
  # Different options represent: when typing halfway, pressing CapsLock, Shift, Control:
  # commit_code  Display the original encoding, then switch to English
  # commit_text  Display the composed phrases, then switch to English
  # clear        Clear the unsent content, then switch to English
  # inline_ascii Switch between Chinese and English when there is no input; when there is input, switch to temporary English mode, return to Chinese state after pressing enter to display
  # noop         Block shortcut keys, do not switch between Chinese and English, but do not block 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
patch:
  # ascii_mode, inline, no_inline, vim_mode, etc. settings can refer to /Library/Input Methods/Squirrel.app/Contents/SharedSupport/squirrel.yaml
  app_options:
    #com.raycast.macos:
    #  ascii_mode: true   # Initial mode is Western
    #com.microsoft.VSCode:
    #  ascii_mode: true   # Initial mode is Western
    #  vim_mode: true
    #md.obsidian:
    #  ascii_mode: true   # Initial mode is Western
    #  vim_mode: true
    #org.alacritty:
    #  ascii_mode: true   # Initial mode is Western
    #com.jetbrains.intellij:
    #  ascii_mode: true
    #  vim_mode: true
  
  style:
    # Choose skin, light and dark themes
    #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
  
    # Preset options: (can be overridden by skin; if the skin does not specify, these properties are used by default.)
    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
  
  # Skin list
  preset_color_schemes:
    macos_light:
      name: "MacOS Light"
      author: 小码哥
      font_face: "PingFangSC"          # Font and size
      font_point: 16
      label_font_face: "PingFangSC"    # Serial number font and size
      label_font_point: 12
      comment_font_face: "PingFangSC"  # Comment font and size
      comment_font_point: 16
      candidate_format: "%c\u2005%@\u2005" # Space before and after number %c and candidate word %@ 
      candidate_list_layout: linear   # Candidate arrangement: stacked | linear
      text_orientation: horizontal    # Text direction: horizontal | vertical
      inline_preedit: true            # Pinyin location: candidate box false | inline true
      translucency: false             # Frosted: false | true
      mutual_exclusive: false         # Color does not overlap: false | true
      border_height: 1                # Outer border height
      border_width: 1                 # Outer border width
      corner_radius: 5                # Outer border corner radius
      hilited_corner_radius: 5       # Selected box corner radius
      surrounding_extra_expansion: 0 # Relative size of candidate background?
      shadow_size: 0                 # Shadow size
      line_spacing: 5                # Line spacing
      base_offset: 0                 # Baseline height
      alpha: 1                       # Transparency, 0~1
      spacing: 10                    # Distance between Pinyin and candidates (inline_preedit: false)
      color_space: srgb                       # Color space: srgb | display_p3
      back_color: 0xFFFFFF                    # Background color
      hilited_candidate_back_color: 0xD75A00  # Selected background color
      label_color: 0x999999                   # Serial number color
      hilited_candidate_label_color: 0xFFFFFF # Selected serial number color
      candidate_text_color: 0x3c3c3c          # Text color
      hilited_candidate_text_color: 0xFFFFFF  # Selected text color
      comment_text_color: 0x999999            # Comment color
      hilited_comment_text_color: 0xFFFFFF    # Selected comment color
      text_color: 0x424242                    # Pinyin color (inline_preedit: false)
      hilited_text_color: 0xFFFFFF            # Selected Pinyin color (inline_preedit: false)
      candidate_back_color: 0xe9e9ea          # Candidate background color
      # preedit_back_color:                   # Pinyin background color (inline_preedit: false)
      hilited_back_color: 0xD75A00            # Selected Pinyin background color (inline_preedit: false)
      border_color: 0xFFFFFF                  # Outer border color
  
    macos_dark:
      name: "MacOS Dark"
      author: 小码哥
      font_face: "PingFangSC"          # Font and size
      font_point: 16
      label_font_face: "PingFangSC"    # Serial number font and size
      label_font_point: 12
      comment_font_face: "PingFangSC"  # Comment font and size
      comment_font_point: 16
      candidate_format: "%c\u2005%@\u2005" # Space before and after number %c and candidate word %@ 
      candidate_list_layout: linear   # Candidate arrangement: stacked | linear
      text_orientation: horizontal    # Text direction: horizontal | vertical
      inline_preedit: true            # Pinyin location: candidate box false | inline true
      translucency: false             # Frosted: false | true
      mutual_exclusive: false         # Color does not overlap: false | true
      border_height: 1                # Outer border height
      border_width: 1                 # Outer border width
      corner_radius: 5                # Outer border corner radius
      hilited_corner_radius: 5       # Selected box corner radius
      surrounding_extra_expansion: 0 # Relative size of candidate background?
      shadow_size: 0                 # Shadow size
      line_spacing: 5                # Line spacing
      base_offset: 0                 # Baseline height
      alpha: 1                       # Transparency, 0~1
      spacing: 10                    # Distance between Pinyin and candidates (inline_preedit: false)
      color_space: srgb                       # Color space: srgb | display_p3
      back_color: 0x1f1e2d                  # Background color
      hilited_candidate_back_color: 0xD75A00  # Selected background color
      label_color: 0x999999                   # Serial number color
      hilited_candidate_label_color: 0xFFFFFF # Selected serial number color
      candidate_text_color: 0xe9e9ea          # Text color
      hilited_candidate_text_color: 0xFFFFFF  # Selected text color
      comment_text_color: 0x999999            # Comment color
      hilited_comment_text_color: 0x999999    # Selected comment color
      text_color: 0x808080                    # Pinyin color (inline_preedit: false)
      hilited_text_color: 0xFFFFFF            # Selected Pinyin color (inline_preedit: false)
      candidate_back_color: 0xe9e9ea          # Candidate background color
      # preedit_back_color:                   # Pinyin background color (inline_preedit: false)
      hilited_back_color: 0xD75A00            # Selected Pinyin background color (inline_preedit: false)
      border_color: 0x050505                  # Outer border color
  
    wechat_light:
      name: "Wechat Light"
      author: 小码哥
      font_face: "PingFangSC"          # Font and size
      font_point: 16
      label_font_face: "PingFangSC"    # Serial number font and size
      label_font_point: 13
      comment_font_face: "PingFangSC"  # Comment font and size
      comment_font_point: 16
      candidate_format: "%c\u2005%@\u2005" # Space before and after number %c and candidate word %@ 
      candidate_list_layout: linear   # Candidate arrangement: stacked | linear
      text_orientation: horizontal    # Text direction: horizontal | vertical
      inline_preedit: true            # Pinyin location: candidate box false | inline true
      translucency: false             # Frosted: false | true
      mutual_exclusive: false         # Color does not overlap: false | true
      border_height: 1                # Outer border height
      border_width: 1                 # Outer border width
      corner_radius: 5                # Outer border corner radius
      hilited_corner_radius: 5       # Selected box corner radius
      surrounding_extra_expansion: 0 # Relative size of candidate background?
      shadow_size: 0                 # Shadow size
      line_spacing: 5                # Line spacing
      base_offset: 0                 # Baseline height
      alpha: 1                       # Transparency, 0~1
      spacing: 10                    # Distance between Pinyin and candidates (inline_preedit: false)
      color_space: srgb                       # Color space: srgb | display_p3
      back_color: 0xFFFFFF                    # Background color
      hilited_candidate_back_color: 0x79af22  # Selected background color
      label_color: 0x999999                   # Serial number color
      hilited_candidate_label_color: 0xFFFFFF # Selected serial number color
      candidate_text_color: 0x3c3c3c          # Text color
      hilited_candidate_text_color: 0xFFFFFF  # Selected text color
      comment_text_color: 0x999999            # Comment color
      hilited_comment_text_color: 0x999999    # Selected comment color
      text_color: 0x424242                    # Pinyin color (inline_preedit: false)
      hilited_text_color: 0x999999            # Selected Pinyin color (inline_preedit: false)
      candidate_back_color: 0xe9e9ea          # Candidate background color
      # preedit_back_color:                   # Pinyin background color (inline_preedit: false)
      hilited_back_color: 0x79af22            # Selected Pinyin background color (inline_preedit: false)
      border_color: 0xFFFFFF                  # Outer border color
  
    wechat_dark:
      name: "Wechat Dark"
      author: 小码哥
      font_face: "PingFangSC"          # Font and size
      font_point: 16
      label_font_face: "PingFangSC"    # Serial number font and size
      label_font_point: 13
      comment_font_face: "PingFangSC"  # Comment font and size
      comment_font_point: 16
      candidate_format: "%c\u2005%@\u2005" # Space before and after number %c and candidate word %@ 
      candidate_list_layout: linear   # Candidate arrangement: stacked | linear
      text_orientation: horizontal    # Text direction: horizontal | vertical
      inline_preedit: true            # Pinyin location: candidate box false | inline true
      translucency: false             # Frosted: false | true
      mutual_exclusive: false         # Color does not overlap: false | true
      border_height: 1                # Outer border height
      border_width: 1                 # Outer border width
      corner_radius: 5                # Outer border corner radius
      hilited_corner_radius: 5       # Selected box corner radius
      surrounding_extra_expansion: 0 # Relative size of candidate background?
      shadow_size: 0                 # Shadow size
      line_spacing: 5                # Line spacing
      base_offset: 0                 # Baseline height
      alpha: 1                       # Transparency, 0~1
      spacing: 10                    # Distance between Pinyin and candidates (inline_preedit: false)
      color_space: srgb                       # Color space: srgb | display_p3
      back_color: 0x151515                    # Background color
      hilited_candidate_back_color: 0x79af22  # Selected background color
      label_color: 0x999999                   # Serial number color
      hilited_candidate_label_color: 0xFFFFFF # Selected serial number color
      candidate_text_color: 0xbbbbbb          # Text color
      hilited_candidate_text_color: 0xFFFFFF  # Selected text color
      comment_text_color: 0x999999            # Comment color
      hilited_comment_text_color: 0xFFFFFF    # Selected comment color
      text_color: 0xbbbbbb                    # Pinyin color (inline_preedit: false)
      hilited_text_color: 0x999999            # Selected Pinyin color (inline_preedit: false)
      candidate_back_color: 0xbbbbbb          # Candidate background color
      # preedit_back_color:                   # Pinyin background color (inline_preedit: false)
      hilited_back_color: 0x79af22            # Selected Pinyin background color (inline_preedit: false)
      border_color: 0x292929                  # Outer border color

Extended Configuration#

  1. Automatically switch between Chinese and English input based on the app
    If you need the input method to automatically switch between Chinese and English input modes based on the app, modify the squirrel.custom.yaml file. The string com.raycast.macos in the configuration is the Bundle ID, which can be found using this command, for example:

    osascript -e 'id of app "Raycast"'

    Image

  2. Change the skin
    If you need to change or modify the skin, also modify the squirrel.custom.yaml file, and update the configuration directly using git pull
    image

Reference#

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.