refactor(fcitx5): ship flypy rime data from NUR

Move the flypy schema data to the rime-data-flypy package in
ryan4yin/nur-packages and keep only the personal user dictionary
(flypy_user.txt) here. The overlay merges the NUR data with that file
and exposes the result as pkgs.rime-data, fcitx5-rime's rimeDataPkgs,
and pkgs.flypy-squirrel.
This commit is contained in:
Ryan Yin committed 2026-10-04 13:29:56 +08:00
1 parent cf6c657e4a
commit d463760e4a
19 files changed
+30 -11288

No files matched your search

+7
View File
@@ -2,6 +2,13 @@
Useful for Linux(fcitx5-rime) & macOS(squirrel). Useful for Linux(fcitx5-rime) & macOS(squirrel).
## Data source
The schema data comes from the `rime-data-flypy` package in
[nur-ryan4yin](https://github.com/ryan4yin/nur-packages). This overlay adds the personal user
dictionary (`flypy_user.txt`) on top and exposes the merged result as `pkgs.rime-data`,
`pkgs.fcitx5-rime`'s `rimeDataPkgs`, and `pkgs.flypy-squirrel`.
## Linux(fcitx5-rime) ## Linux(fcitx5-rime)
1. `~/.config/fcitx5/profile` is linked to 1. `~/.config/fcitx5/profile` is linked to
+23 -10
View File
@@ -1,12 +1,25 @@
# 为了不使用默认的 rime-data,改用我自定义的小鹤音形数据,这里需要 override # 为了不使用默认的 rime-data,改用小鹤音形数据,这里需要 override
# 参考 https://github.com/NixOS/nixpkgs/blob/e4246ae1e7f78b7087dce9c9da10d28d3725025f/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix # 参考 https://github.com/NixOS/nixpkgs/blob/e4246ae1e7f78b7087dce9c9da10d28d3725025f/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix
_: { inputs, ... }:
(_: super: { (
# 小鹤音形配置,配置来自 flypy.com 官方网盘的鼠须管配置压缩包「小鹤音形“鼠须管”for macOS.zip」 _: super:
# 我仅修改了 default.yaml 文件,将其中的半角括号改为了直角括号「 与 」。 let
rime-data = ./rime-data-flypy; # 小鹤音形 schema 数据,来自 nur-ryan4yin 的 rime-data-flypy,
fcitx5-rime = super.fcitx5-rime.override { rimeDataPkgs = [ ./rime-data-flypy ]; }; # 再叠加我自己的用户词库 flypy_user.txt。
rime-data-flypy = inputs.nur-ryan4yin.packages.${super.stdenv.hostPlatform.system}.rime-data-flypy;
# used by macOS Squirrel rime-data = super.runCommandLocal "rime-data-flypy-custom" { } ''
flypy-squirrel = ./rime-data-flypy; mkdir -p $out/share/rime-data
}) cp -r ${rime-data-flypy}/share/rime-data/. $out/share/rime-data/
chmod -R u+w $out/share/rime-data
cp ${./flypy_user.txt} $out/share/rime-data/flypy_user.txt
'';
in
{
inherit rime-data;
fcitx5-rime = super.fcitx5-rime.override { rimeDataPkgs = [ rime-data ]; };
# used by macOS Squirrel
flypy-squirrel = rime-data;
}
)
@@ -1,38 +0,0 @@
customization:
distribution_code_name: Squirrel
distribution_version: 2019-06-23
rime_version: 1.5.3
patch:
schema_list:
- schema: flypy # 添加小鹤音形
#
# 可用的按键有 Caps_Lock, Shift_L, Shift_R, Control_L, control_R
# Mac 系统上的鼠须管不能区分左、右,因此只有对 Shift_L, Control_L 的设定起作用
#
# 已输入编码时按切换键,可以进一步设定输入法中西文切换的形式
# 可选的临时切换策略有三:
# inline_ascii 在输入法的临时西文编辑区内输入字母、数字、符号、空格等,回车上屏后自动复位到中文
# commit_text 已输入的候选文字上屏并切换至西文输入模式
# commit_code 已输入的编码字符上屏并切换至西文输入模式
# 设为 noop, 屏蔽该切换键
#
# 如果要把Caps Lock 设为只改变字母的大小写而不做中西文切换,可将 Caps_Lock 对应的切换方式设为 noop
# 如果要以Caps Lock 切换到西文模式,默认输出小写字母,请置 ascii_composer/good_old_caps_lock: false
# 如果要以Caps Lock 切换到西文模式,默认输出大写字母,请置 ascii_composer/good_old_caps_lock: true
ascii_composer/good_old_caps_lock: true
ascii_composer/switch_key:
Caps_Lock: noop
Shift_L: commit_code
Shift_R: noop
Control_L: noop
Control_R: noop
key_binder/bindings:
- when: paging
accept: bracketleft
send: Page_Up
- when: has_menu
accept: bracketright
send: Page_Down
@@ -1,148 +0,0 @@
# Rime default settings
# encoding: utf-8
config_version: "0.38"
schema_list:
- schema: flypy
switcher:
caption: 〔方案选单〕
hotkeys:
- Control+grave
- Control+Shift+grave
- F4
save_options:
- full_shape
- ascii_punct
- simplification
fold_options: true
abbreviate_options: true
#option_list_separator: '/'
menu:
page_size: 5
punctuator:
full_shape: # replace full_shape with half_shape
",": { commit: , }
".": { commit: 。 }
"<": [《, 〈, «, ‹]
">": [》, 〉, », ›]
"/": { commit: 、 }
"?": { commit: ? }
";": { commit: ; }
":": { commit: : }
"'": { pair: ["‘", "’"] }
'"': { pair: ["“", "”"] }
'\': { commit: 、 }
"|": "|"
"`": "`"
"~": { commit: ~ }
"!": { commit: ! }
"@": "@"
"#": "#"
"%": { commit: "%" }
"$": { commit: "$" }
"^": { commit: …… }
"&": "&"
"*": { commit: "*" }
"(": (
")": )
"-": "-"
"_": ——
"+": "+"
"=": "="
"[": [「, 【, 〔, []
"]": [」, 】, 〕, ]]
"{": [『, 〖, {]
"}": [』, 〗, }]
half_shape:
",": { commit: , }
".": { commit: 。 }
"<": [《, 〈, «, ‹]
">": [》, 〉, », ›]
"/": { commit: 、 }
"?": { commit: ? }
";": { commit: ; }
":": { commit: : }
"'": { pair: ["‘", "’"] }
'"': { pair: ["“", "”"] }
'\': { commit: 、 }
"|": "|"
"`": "`"
"~": { commit: ~ }
"!": { commit: ! }
"@": "@"
"#": "#"
"%": { commit: "%" }
"$": { commit: "$" }
"^": { commit: …… }
"&": "&"
"*": { commit: "*" }
"(": (
")": )
"-": "-"
"_": ——
"+": "+"
"=": "="
"[": [「, 【, 〔, []
"]": [」, 】, 〕, ]]
"{": [『, 〖, {]
"}": [』, 〗, }]
key_binder:
bindings:
# Emacs style
- { when: composing, accept: Control+p, send: Up }
- { when: composing, accept: Control+n, send: Down }
- { when: composing, accept: Control+b, send: Left }
- { when: composing, accept: Control+f, send: Right }
- { when: composing, accept: Control+a, send: Home }
- { when: composing, accept: Control+e, send: End }
- { when: composing, accept: Control+d, send: Delete }
- { when: composing, accept: Control+k, send: Shift+Delete }
- { when: composing, accept: Control+h, send: BackSpace }
- { when: composing, accept: Control+g, send: Escape }
- { when: composing, accept: Control+bracketleft, send: Escape }
- { when: composing, accept: Alt+v, send: Page_Up }
- { when: composing, accept: Control+v, send: Page_Down }
# move by word
- { when: composing, accept: ISO_Left_Tab, send: Shift+Left }
- { when: composing, accept: Shift+Tab, send: Shift+Left }
- { when: composing, accept: Tab, send: Shift+Right }
# flip page
- { when: has_menu, accept: minus, send: Page_Up }
- { when: has_menu, accept: equal, send: Page_Down }
- { when: paging, accept: comma, send: Page_Up }
- { when: has_menu, accept: period, send: Page_Down }
# hotkey switch
- { when: always, accept: Control+Shift+1, select: .next }
- { when: always, accept: Control+Shift+2, toggle: ascii_mode }
- { when: always, accept: Control+Shift+3, toggle: full_shape }
- { when: always, accept: Control+Shift+4, toggle: simplification }
- { when: always, accept: Control+Shift+5, toggle: extended_charset }
- { when: always, accept: Control+Shift+exclam, select: .next }
- { when: always, accept: Control+Shift+at, toggle: ascii_mode }
- { when: always, accept: Control+Shift+numbersign, toggle: full_shape }
- { when: always, accept: Control+Shift+dollar, toggle: simplification }
- { when: always, accept: Control+Shift+percent, toggle: extended_charset }
- { when: always, accept: Shift+space, toggle: full_shape }
- { when: always, accept: Control+period, toggle: ascii_punct }
recognizer:
patterns:
uppercase: "[A-Z][-_+.'0-9A-Za-z]*$"
reverse_lookup: "[a-z`]*`+[a-z`]*"
punct: ""
ascii_composer:
good_old_caps_lock: true
switch_key:
Shift_L: inline_ascii
Shift_R: commit_text
Control_L: noop
Control_R: noop
Caps_Lock: clear
Eisu_toggle: clear
@@ -1,160 +0,0 @@
# Rime schema settings
# encoding: utf-8
schema:
schema_id: flypy
name: 小鹤音形
version: "10.9.4"
author:
- 方案设计:何海峰 <flypy@qq.com>
description: |
小鹤音形输入法
punctuator:
import_preset: default
switches:
- name: ascii_mode
reset: 0
# states: [ 中文, 英文 ]
- name: full_shape
# states: [ 半角, 全角 ]
- name: simplification
# states: [ 简, 繁 ]
reset: 0
- name: ascii_punct
# states: [ 。,, ., ]
reset: 0
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- table_translator
- lua_translator@date_translator
- lua_translator@time_translator
- table_translator@custom_phraseVD
- table_translator@custom_phraseXT
- table_translator@custom_phraseYH
- table_translator@custom_phraseQMZ
- reverse_lookup_translator
- history_translator@history
- lua_translator@calculator_translator
filters:
- simplifier
- simplifier@simplification
- uniquifier
speller:
alphabet: "abcdefghijklmnopqrstuvwxyz;'"
initials: ";abcdefghijklmnopqrstuvwxyz"
finals: "'"
#delimiter: " '"
max_code_length: 4
auto_select: true #顶字上屏
auto_select_pattern: ^;.$|^\w{4}$
auto_clear: max_length #manual|auto|max_length 空码按下一键确认清屏|空码自动清|达到最长码时后码顶上清屏
translator:
dictionary: flypy
enable_charset_filter: false
enable_sentence: false
enable_completion: false # 编码提示开关
enable_user_dict: false
disable_user_dict_for_patterns:
- "^z.*$"
history:
input: ;f
size: 1 #重复前几次上屏
initial_quality: 1 #首选
simplification:
opencc_config: s2tw.json
option_name: simplification
tips: all #简繁对照
custom_phraseVD:
dictionary: ""
user_dict: flypy_top
db_class: stabledb
enable_sentence: false
enable_completion: false
initial_quality: 0 #用户词和系统词重码 置顶
custom_phraseXT:
dictionary: ""
user_dict: flypy_sys
db_class: stabledb
enable_sentence: false
enable_completion: false
initial_quality: -1 #本表词和系统词重码居后
custom_phraseYH:
dictionary: ""
user_dict: flypy_user
db_class: stabledb
enable_sentence: false
enable_completion: false
initial_quality: -1 #用户词和系统词重码居后
custom_phraseQMZ:
dictionary: ""
user_dict: flypy_full
db_class: stabledb
enable_sentence: false
enable_completion: false
initial_quality: -1 #和系统词重码时居后
reverse_lookup:
dictionary: flypydz
comment_format:
# - xform/^/〔/
# - xform/$/〕/
- xform/ / /
key_binder:
import_preset: default #方案切换相关
bindings:
- { accept: bracketleft, send: Page_Up, when: paging } # [上翻页
- { accept: bracketright, send: Page_Down, when: has_menu } # ]下翻页
- { accept: comma, send: comma, when: paging } #注销逗号翻页
- { accept: period, send: period, when: has_menu } #注销句号翻页
- { accept: semicolon, send: 2, when: has_menu } #分号次选
# - {accept: Release+semicolon, send: semicolon, when: has_menu} #如启用此行,则分号引导符号功能无效
- { accept: Release+period, send: period, when: composing } #句号顶屏
- { accept: Release+comma, send: comma, when: composing } #逗号顶屏
- { accept: "Tab", send: Escape, when: composing }
- { accept: "Shift_R", send: Escape, when: composing }
- { accept: "Shift+space", toggle: full_shape, when: always } #切换全半角
- { accept: "Control+period", toggle: ascii_punct, when: always } #切换中英标点
- { accept: "Control+j", toggle: simplification, when: always } #切换简繁
recognizer:
import_preset: default
patterns:
#uppercase: "[A-Z][-_+.'0-9A-Za-z]*$"
uppercase: "" #中文状态大写锁定直接上屏
reverse_lookup: "[a-z`]*`+[a-z`]*"
punct: ""
expression: "^=.*$"
menu:
page_size: 5 #候选项数
style:
horizontal: true #竖排为false
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -1,51 +0,0 @@
# coding: utf-8
# 置顶词库(与系统词条重码时居前)
#
# 编码格式:字词+Tab符+编码(用户词库本身有重码则还需后面+Tab符+权重,权重大者居前,权重数字随意)
#
# ------------ 强调一下 ------------
#
# 词条和编码之间的不是空格,而是Tab符,如果你不知道,就复制下面编码中的空白处
# 或者按住键盘 G 键,切换到功能键盘,使用上面的Tab键
#
# ---------------------------------------
#
# 分号冒号编码只能放此文件才能调频,如分号做次选需删除权重,外接键盘适用
: ;
; ; 90
# 如用户词无重或和系统词条重码时居前,则无需权重(如想居于系统词条后,请把词条放到flypy_user.txt文件内)
# 虽然文本码表编辑较为方便,但不适合导入大量条目
# 置顶用户词库,下一行开始添加,部署后生效
# 全码词
即可 jike
知道 vidc
只能 ving
简单 jmdj
计算 jisr
一下 yixx
一直 yivi
只是 viui
按时 anui
而是 erui
成为 igww
小时 xnui
简直 jmvi
任务 rfwu
时间 uijm
水平 uvpk
试试 uiui
神似 ufsi
传统 irts
台湾 tdwj
反应 fjyk
每周 mwvz
联系 lmxi
现金 xmjb
期间 qijm
极其 jiqi
在线 zdxm
只会 vihv
一片 yipm
美丽 mwli
几位 jiww
@@ -1,402 +0,0 @@
-- Rime Script >https://github.com/baopaau/rime-lua-collection/blob/master/calculator_translator.lua
-- 簡易計算器(執行任何Lua表達式)
--
-- 格式:=<exp>
-- Lambda語法糖:\<arg>.<exp>|
--
-- 例子:
-- =1+1 輸出 2
-- =floor(9^(8/7)*cos(deg(6))) 輸出 -3
-- =e^pi>pi^e 輸出 true
-- =max({1,7,2}) 輸出 7
-- =map({1,2,3},\x.x^2|) 輸出 {1, 4, 9}
-- =map(range(-5,5),\x.x*pi/4|,deriv(sin)) 輸出 {-0.7071, -1, -0.7071, 0, 0.7071, 1, 0.7071, 0, -0.7071, -1}
-- =$(range(-5,5,0.01))(map,\x.-60*x^2-16*x+20|)(max)() 輸出 21.066
-- =test(\x.trunc(sin(x),1e-3)==trunc(deriv(cos)(x),1e-3)|,range(-2,2,0.1)) 輸出 true
--
-- 安装:
-- - 將本文件保存至 <rime>/lua/
-- - 在 <rime>/rime.lua 新增一行:
-- `calculator_translator = require("calculator_translator")`
-- - 在 <rime>/<schema>.schema.yaml 新增:
-- `engine/translators/@next: lua_translator@calculator_translator`
-- `recognizer/patterns/expression: "^=.*$"`
-- 註:
-- - <rime> 替換爲RIME的共享目錄
-- - <schema> 替換爲自己的方案ID
-- - 如目錄/文件不存在,請自行創建
-- 定義全局函數、常數(注意命名空間污染)
cos = math.cos
sin = math.sin
tan = math.tan
acos = math.acos
asin = math.asin
atan = math.atan
rad = math.rad
deg = math.deg
abs = math.abs
floor = math.floor
ceil = math.ceil
mod = math.fmod
trunc = function (x, dc)
if dc == nil then
return math.modf(x)
end
return x - mod(x, dc)
end
round = function (x, dc)
dc = dc or 1
local dif = mod(x, dc)
if abs(dif) > dc / 2 then
return x < 0 and x - dif - dc or x - dif + dc
end
return x - dif
end
random = math.random
randomseed = math.randomseed
inf = math.huge
MAX_INT = math.maxinteger
MIN_INT = math.mininteger
pi = math.pi
sqrt = math.sqrt
exp = math.exp
e = exp(1)
ln = math.log
log = function (x, base)
base = base or 10
return ln(x)/ln(base)
end
min = function (arr)
local m = inf
for k, x in ipairs(arr) do
m = x < m and x or m
end
return m
end
max = function (arr)
local m = -inf
for k, x in ipairs(arr) do
m = x > m and x or m
end
return m
end
sum = function (t)
local acc = 0
for k,v in ipairs(t) do
acc = acc + v
end
return acc
end
avg = function (t)
return sum(t) / #t
end
isinteger = function (x)
return math.fmod(x, 1) == 0
end
-- iterator . array
array = function (...)
local arr = {}
for v in ... do
arr[#arr + 1] = v
end
return arr
end
-- iterator <- [form, to)
irange = function (from, to, step)
if to == nil then
to = from
from = 0
end
step = step or 1
local i = from - step
to = to - step
return function()
if i < to then
i = i + step
return i
end
end
end
-- array <- [form, to)
range = function (from, to, step)
return array(irange(from, to, step))
end
-- array . reversed iterator
irev = function (arr)
local i = #arr + 1
return function()
if i > 1 then
i = i - 1
return arr[i]
end
end
end
-- array . reversed array
arev = function (arr)
return array(irev(arr))
end
test = function (f, t)
for k,v in ipairs(t) do
if not f(v) then
return false
end
end
return true
end
-- # Functional
map = function (t, ...)
local ta = {}
for k,v in pairs(t) do
local tmp = v
for _,f in pairs({...}) do tmp = f(tmp) end
ta[k] = tmp
end
return ta
end
filter = function (t, ...)
local ta = {}
local i = 1
for k,v in pairs(t) do
local erase = false
for _,f in pairs({...}) do
if not f(v) then
erase = true
break
end
end
if not erase then
ta[i] = v
i = i + 1
end
end
return ta
end
-- e.g: foldr({2,3},\n,x.x^n|,2) = 81
foldr = function (t, f, acc)
for k,v in pairs(t) do
acc = f(acc, v)
end
return acc
end
-- e.g: foldl({2,3},\n,x.x^n|,2) = 512
foldl = function (t, f, acc)
for v in irev(t) do
acc = f(acc, v)
end
return acc
end
-- 調用鏈生成函數(HOF for method chaining)
-- e.g: chain(range(-5,5))(map,\x.x/5|)(map,sin)(map,\x.e^x*10|)(map,floor)()
-- = floor(map(map(map(range(-5,5),\x.x/5|),sin),\x.e^x*10|))
-- = {4, 4, 5, 6, 8, 10, 12, 14, 17, 20}
-- 可以用 $ 代替 chain
chain = function (t)
local ta = t
local function cf(f, ...)
if f ~= nil then
ta = f(ta, ...)
return cf
else
return ta
end
end
return cf
end
-- # Statistics
fac = function (n)
local acc = 1
for i = 2,n do
acc = acc * i
end
return acc
end
nPr = function (n, r)
return fac(n) / fac(n - r)
end
nCr = function (n, r)
return nPr(n,r) / fac(r)
end
MSE = function (t)
local ss = 0
local s = 0
local n = #t
for k,v in ipairs(t) do
ss = ss + v*v
s = s + v
end
return sqrt((n*ss - s*s) / (n*n))
end
-- # Linear Algebra
-- # Calculus
-- Linear approximation
lapproxd = function (f, delta)
local delta = delta or 1e-8
return function (x)
return (f(x+delta) - f(x)) / delta
end
end
-- Symmetric approximation
sapproxd = function (f, delta)
local delta = delta or 1e-8
return function (x)
return (f(x+delta) - f(x-delta)) / delta / 2
end
end
-- 近似導數
deriv = function (f, delta, dc)
dc = dc or 1e-4
local fd = sapproxd(f, delta)
return function (x)
return round(fd(x), dc)
end
end
-- Trapezoidal rule
trapzo = function (f, a, b, n)
local dif = b - a
local acc = 0
for i = 1, n-1 do
acc = acc + f(a + dif * (i/n))
end
acc = acc * 2 + f(a) + f(b)
acc = acc * dif / n / 2
return acc
end
-- 近似積分
integ = function (f, delta, dc)
delta = delta or 1e-4
dc = dc or 1e-4
return function (a, b)
if b == nil then
b = a
a = 0
end
local n = round(abs(b - a) / delta)
return round(trapzo(f, a, b, n), dc)
end
end
-- Runge-Kutta
rk4 = function (f, timestep)
local timestep = timestep or 0.01
return function (start_x, start_y, time)
local x = start_x
local y = start_y
local t = time
-- loop until i >= t
for i = 0, t, timestep do
local k1 = f(x, y)
local k2 = f(x + (timestep/2), y + (timestep/2)*k1)
local k3 = f(x + (timestep/2), y + (timestep/2)*k2)
local k4 = f(x + timestep, y + timestep*k3)
y = y + (timestep/6)*(k1 + 2*k2 + 2*k3 + k4)
x = x + timestep
end
return y
end
end
-- # System
date = os.date
time = os.time
path = function ()
return debug.getinfo(1).source:match("@?(.*/)")
end
local function serialize(obj)
local type = type(obj)
if type == "number" then
return isinteger(obj) and floor(obj) or obj
elseif type == "boolean" then
return tostring(obj)
elseif type == "string" then
return '"'..obj..'"'
elseif type == "table" then
local str = "{"
local i = 1
for k, v in pairs(obj) do
if i ~= k then
str = str.."["..serialize(k).."]="
end
str = str..serialize(v)..", "
i = i + 1
end
str = str:len() > 3 and str:sub(0,-3) or str
return str.."}"
elseif pcall(obj) then -- function類型
return "callable"
end
return obj
end
-- greedy:隨時求值(每次變化都會求值,否則結尾爲特定字符時求值)
local greedy = true
local function calculator_translator(input, seg)
if string.sub(input, 1, 1) ~= "=" then return end
local expfin = greedy or string.sub(input, -1, -1) == ";"
local exp = (greedy or not expfin) and string.sub(input, 2, -1) or string.sub(input, 2, -2)
-- 空格輸入可能
exp = exp:gsub("#", " ")
if not expfin then return end
local expe = exp
-- 鏈式調用語法糖
expe = expe:gsub("%$", " chain ")
-- lambda語法糖
do
local count
repeat
expe, count = expe:gsub("\\%s*([%a%d%s,_]-)%s*%.(.-)|", " (function (%1) return %2 end) ")
until count == 0
end
--yield(Candidate("number", seg.start, seg._end, expe, "展開"))
-- 防止危險操作,禁用os和io命名空間
if expe:find("i?os?%.") then return end
-- return語句保證了只有合法的Lua表達式才可執行
local result = load("return "..expe)()
if result == nil then return end
result = serialize(result)
yield(Candidate("number", seg.start, seg._end, exp.."="..result, ""))
end
return calculator_translator
@@ -1,17 +0,0 @@
function date_translator(input, seg)
if (input == "orq") then
--- Candidate(type, start, end, text, comment)
yield(Candidate("date", seg.start, seg._end, os.date("%Y年%m月%d日"), ""))
yield(Candidate("date", seg.start, seg._end, os.date("%Y-%m-%d"), " "))
end
end
function time_translator(input, seg)
if (input == "ouj") then
local cand = Candidate("time", seg.start, seg._end, os.date("%H:%M"), " ")
cand.quality = 1
yield(cand)
end
end
calculator_translator = require("calculator_translator")
@@ -1,38 +0,0 @@
customization:
distribution_code_name: squirrel
distribution_version: 0.14.0
generator: "squirrel::UIStyleSettings"
modified_time: "2019-06-23"
rime_version: 1.5.3
patch:
"preset_color_schemes/metro":
author: "flypy.com"
back_color: 0xffffff # 候选条背景色
border_color_width: 1
#border_color: 0xe89f00 # 边框色
#preedit_back_color: 0xf0403516 #新增,未知其意
border_height: 8 # 窗口边界高度,大于圆角半径才生效
border_width: 8 # 窗口边界宽度,大于圆角半径才生效
candidate_format: "%c\u2005%@\u2005" # 用 1/6 em 空格 U+2005 来控制编号 %c 和候选词 %@ 前后的空间。
corner_radius: 6 # 窗口圆角半径
#hilited_corner_radius: 6 # 高亮圆角
hilited_text_color: 0x000000 # 编码高亮
hilited_back_color: 0xffffff # 编码背景高亮
hilited_candidate_label_color: 0xeeeeee # 首选编号色
hilited_candidate_text_color: 0xffffff # 首选文字色
hilited_candidate_back_color: 0xe89f00 # 首选背景色
hilited_comment_text_color: 0xcccccc # 首选提示字母色
label_color: 0x555555 # 次选编号色
candidate_text_color: 0x000000 # 次选文字色
candidate_back_color: 0xffffff # 次选背景色
comment_text_color: 0x555555 # 次选提示字母色
horizontal: true # 候选窗横向显示
font_point: 18 # 候选窗文字字号
label_font_point: 14 # 候选窗编号字号
inline_preedit: true # 开启嵌入编码
name: "metro"
text_color: 0x333333 # 编码行文字颜色,24位色值,16进制,BGR顺序
"style/line_spacing": 12 # 候选词的行间距
"style/color_scheme": metro
"style/display_tray_icon": false
"style/text_orientation": horizontal # horizontal | vertical
@@ -1,372 +0,0 @@
# Squirrel settings
# encoding: utf-8
config_version: "0.37"
us_keyboard_layout: true
# for veteran chord-typist
chord_duration: 0.1 # seconds
# options: always | never | appropriate
show_notifications_when: appropriate
style:
color_scheme: native
# optional: define both light and dark color schemes to match system appearance
#color_scheme: solarized_light
#color_scheme_dark: solarized_dark
# Deprecated since 0.36, Squirrel 0.15
#horizontal: false
# NOTE: do not set a default value for `candidate_list_layout`, in order to
# keep the deprecated `horizontal` option working for existing users.
#candidate_list_layout: stacked # stacked | linear
text_orientation: horizontal # horizontal | vertical
inline_preedit: true
corner_radius: 10
hilited_corner_radius: 0
border_height: 0
border_width: 0
# space between candidates in stacked layout
line_spacing: 5
# space between preedit and candidates in non-inline mode
spacing: 10
#candidate_format: '%c. %@'
# adjust the base line of vertical text
#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:
native:
name: 系統配色
aqua:
name: 碧水/Aqua
author: 佛振 <chen.sst@gmail.com>
text_color: 0x606060
back_color: 0xeeeceeee
candidate_text_color: 0x000000
hilited_text_color: 0x000000
hilited_candidate_text_color: 0xffffff
hilited_candidate_back_color: 0xeefa3a0a
comment_text_color: 0x5a5a5a
hilited_comment_text_color: 0xfcac9d
azure:
name: 青天/Azure
author: 佛振 <chen.sst@gmail.com>
text_color: 0xcfa677
candidate_text_color: 0xffeacc
back_color: 0xee8b4e01
hilited_text_color: 0xffeacc
hilited_candidate_text_color: 0x7ffeff
hilited_candidate_back_color: 0x00000000
comment_text_color: 0xc69664
luna:
name: 明月/Luna
author: 佛振 <chen.sst@gmail.com>
text_color: 0xa5a5a5
back_color: 0xdd000000
candidate_text_color: 0xeceeee
hilited_text_color: 0x7fffff
hilited_candidate_text_color: 0x7fffff
hilited_candidate_back_color: 0x40000000
comment_text_color: 0xa5a5a5
hilited_comment_text_color: 0x449c9d
ink:
name: 墨池/Ink
author: 佛振 <chen.sst@gmail.com>
text_color: 0x5a5a5a
back_color: 0xeeffffff
candidate_text_color: 0x000000
hilited_text_color: 0x000000
#hilited_back_color: 0xdddddd
hilited_candidate_text_color: 0xffffff
hilited_candidate_back_color: 0xcc000000
comment_text_color: 0x5a5a5a
hilited_comment_text_color: 0x808080
lost_temple:
name: 孤寺/Lost Temple
author: 佛振 <chen.sst@gmail.com>, based on ir_black
text_color: 0xe8f3f6
back_color: 0xee303030
hilited_text_color: 0x82e6ca
hilited_candidate_text_color: 0x000000
hilited_candidate_back_color: 0x82e6ca
comment_text_color: 0xbb82e6ca
hilited_comment_text_color: 0xbb203d34
dark_temple:
name: 暗堂/Dark Temple
author: 佛振 <chen.sst@gmail.com>, based on ir_black
text_color: 0x92f6da
back_color: 0x222222
candidate_text_color: 0xd8e3e6
hilited_text_color: 0xffcf9a
hilited_back_color: 0x222222
hilited_candidate_text_color: 0x92f6da
hilited_candidate_back_color: 0x10000000 # 0x333333
comment_text_color: 0x606cff
psionics:
name: 幽能/Psionics
author: 雨過之後、佛振
text_color: 0xc2c2c2
back_color: 0x444444
candidate_text_color: 0xeeeeee
hilited_text_color: 0xeeeeee
hilited_back_color: 0x444444
hilited_candidate_label_color: 0xfafafa
hilited_candidate_text_color: 0xfafafa
hilited_candidate_back_color: 0xd4bc00
comment_text_color: 0x808080
hilited_comment_text_color: 0x444444
purity_of_form:
name: 純粹的形式/Purity of Form
author: 雨過之後、佛振
text_color: 0xc2c2c2
back_color: 0x444444
candidate_text_color: 0xeeeeee
hilited_text_color: 0xeeeeee
hilited_back_color: 0x444444
hilited_candidate_text_color: 0x000000
hilited_candidate_back_color: 0xfafafa
comment_text_color: 0x808080
purity_of_essence:
name: 純粹的本質/Purity of Essence
author: 佛振
text_color: 0x2c2ccc
back_color: 0xfafafa
candidate_text_color: 0x000000
hilited_text_color: 0x000000
hilited_back_color: 0xfafafa
hilited_candidate_text_color: 0xeeeeee
hilited_candidate_back_color: 0x444444
comment_text_color: 0x808080
starcraft:
name: 星際我爭霸/StarCraft
author: Contralisk <contralisk@gmail.com>, original artwork by Blizzard Entertainment
text_color: 0xccaa88
candidate_text_color: 0x30bb55
back_color: 0xee000000
border_color: 0x1010a0
hilited_text_color: 0xfecb96
hilited_back_color: 0x000000
hilited_candidate_text_color: 0x70ffaf
hilited_candidate_back_color: 0x00000000
comment_text_color: 0x1010d0
hilited_comment_text_color: 0x1010f0
google:
name: 谷歌/Google
author: skoj <skoj@qq.com>
text_color: 0x666666 #拼音串
candidate_text_color: 0x000000 #非第一候选项
back_color: 0xFFFFFF #背景
border_color: 0xE2E2E2 #边框
hilited_text_color: 0x000000 #拼音串高亮
hilited_back_color: 0xFFFFFF #拼音串高亮背景
hilited_candidate_text_color: 0xFFFFFF #第一候选项
hilited_candidate_back_color: 0xCE7539 #第一候选项背景
comment_text_color: 0x6D6D6D #注解文字
hilited_comment_text_color: 0xEBC6B0 #注解文字高亮
solarized_rock:
name: 曬經石/Solarized Rock
author: "Aben <tntaben@gmail.com>, based on Ethan Schoonover's Solarized color scheme"
back_color: 0x362b00
border_color: 0x362b00
text_color: 0x8236d3
hilited_text_color: 0x98a12a
candidate_text_color: 0x969483
comment_text_color: 0xc098a12a
hilited_candidate_text_color: 0xffffff
hilited_candidate_back_color: 0x8236d3
hilited_comment_text_color: 0x362b00
clean_white:
name: 简约白/Clean White
author: Chongyu Zhu <lembacon@gmail.com>, based on 搜狗「简约白」
horizontal: true
candidate_format: "%c %@"
corner_radius: 6
border_height: 6
border_width: 6
font_point: 16
label_font_point: 12
label_color: 0x888888
text_color: 0x808080
hilited_text_color: 0x000000
candidate_text_color: 0x000000
comment_text_color: 0x808080
back_color: 0xeeeeee
hilited_candidate_label_color: 0xa0c98915
hilited_candidate_text_color: 0xc98915
hilited_candidate_back_color: 0xeeeeee
apathy:
name: 冷漠/Apathy
author: LIANG Hai
horizontal: true # 水平排列
inline_preedit: true #单行显示,false双行显示
candidate_format: "%c\u2005%@\u2005" # 编号 %c 和候选词 %@ 前后的空间
corner_radius: 5 #候选条圆角
border_height: 0
border_width: 0
back_color: 0xFFFFFF #候选条背景色
font_face: "PingFangSC-Regular,HanaMinB" #候选词字体
font_point: 16 #候选字词大小
text_color: 0x424242 #高亮选中词颜色
label_font_face: "STHeitiSC-Light" #候选词编号字体
label_font_point: 12 #候选编号大小
hilited_candidate_text_color: 0xEE6E00 #候选文字颜色
hilited_candidate_back_color: 0xFFF0E4 #候选文字背景色
comment_text_color: 0x999999 #拼音等提示文字颜色
dust:
name: 浮尘/Dust
author: Superoutman <asticosmo@gmail.com>
horizontal: true # 水平排列
inline_preedit: true #单行显示,false双行显示
candidate_format: "%c\u2005%@\u2005" # 用 1/6 em 空格 U+2005 来控制编号 %c 和候选词 %@ 前后的空间。
corner_radius: 2 #候选条圆角
border_height: 3 # 窗口边界高度,大于圆角半径才生效
border_width: 8 # 窗口边界宽度,大于圆角半径才生效
back_color: 0xeeffffff #候选条背景色
border_color: 0xE0B693 # 边框色
font_face: "HYQiHei-55S Book,HanaMinA Regular" #候选词字体
font_point: 14 #候选字词大小
label_font_face: "SimHei" #候选词编号字体
label_font_point: 10 #候选编号大小
label_color: 0xcbcbcb # 预选栏编号颜色
candidate_text_color: 0x555555 # 预选项文字颜色
text_color: 0x424242 # 拼音行文字颜色,24位色值,16进制,BGR顺序
comment_text_color: 0x999999 # 拼音等提示文字颜色
hilited_text_color: 0x9e9e9e # 高亮拼音 (需要开启内嵌编码)
hilited_candidate_text_color: 0x000000 # 第一候选项文字颜色
hilited_candidate_back_color: 0xfff0e4 # 第一候选项背景背景色
hilited_candidate_label_color: 0x555555 # 第一候选项编号颜色
hilited_comment_text_color: 0x9e9e9e # 注解文字高亮
mojave_dark:
name: 沙漠夜/Mojave Dark
author: xiehuc <xiehuc@gmail.com>
horizontal: true # 水平排列
inline_preedit: true # 单行显示,false双行显示
candidate_format: "%c\u2005%@" # 用 1/6 em 空格 U+2005 来控制编号 %c 和候选词 %@ 前后的空间。
corner_radius: 5 # 候选条圆角
hilited_corner_radius: 3 # 高亮圆角
border_height: 6 # 窗口边界高度,大于圆角半径才生效
border_width: 6 # 窗口边界宽度,大于圆角半径才生效
font_face: "PingFangSC" # 候选词字体
font_point: 16 # 候选字词大小
label_font_point: 14 # 候选编号大小
text_color: 0xdedddd # 拼音行文字颜色,24位色值,16进制,BGR顺序
back_color: 0x252320 # 候选条背景色
label_color: 0x888785 # 预选栏编号颜色
border_color: 0x020202 # 边框色
candidate_text_color: 0xdedddd # 预选项文字颜色
hilited_text_color: 0xdedddd # 高亮拼音 (需要开启内嵌编码)
hilited_back_color: 0x252320 # 高亮拼音 (需要开启内嵌编码)
hilited_candidate_text_color: 0xffffff # 第一候选项文字颜色
hilited_candidate_back_color: 0xcb5d00 # 第一候选项背景背景色
hilited_candidate_label_color: 0xffffff # 第一候选项编号颜色
comment_text_color: 0xdedddd # 拼音等提示文字颜色
#hilited_comment_text_color: 0xdedddd # 注解文字高亮
solarized_light:
name: 曬經・日/Solarized Light
author: 雪齋 <lyc20041@gmail.com>
color_space: display_p3 # Only available on macOS 10.12+
back_color: 0xf0E5F6FB #Lab 97, 0, 10
border_color: 0xf0EDFFFF #Lab 100, 0, 10
preedit_back_color: 0xf0D7E8ED #Lab 92, 0, 10
candidate_text_color: 0x3942CB #Lab 50, 65, 45
label_color: 0x2566C6 #Lab 55, 45, 65
comment_text_color: 0x8144C2 #Lab 50, 65, -5
text_color: 0x756E5D #Lab 45, -7, -7
hilited_back_color: 0xf0C9DADF #Lab 87, 0, 10
hilited_candidate_back_color: 0x403516 #Lab 20, -12, -12
hilited_candidate_text_color: 0x989F52 #Lab 60, -35, -5
hilited_candidate_label_color: 0xCC8947 #Lab 55, -10, -45
hilited_comment_text_color: 0x289989 #Lab 60, -20, 65
hilited_text_color: 0xBE706D #Lab 50, 15, -45
solarized_dark:
name: 曬經・月/Solarized Dark
author: 雪齋 <lyc20041@gmail.com>
color_space: display_p3 # Only available on macOS 10.12+
back_color: 0xf0352A0A #Lab 15, -12, -12
border_color: 0xf02A1F00 #Lab 10, -12, -12
preedit_back_color: 0xf0403516 #Lab 20, -12, -12
candidate_text_color: 0x989F52 #Lab 60, -35, -5
label_color: 0xCC8947 #Lab 55, -10, -45
comment_text_color: 0x289989 #Lab 60, -20, 65
text_color: 0xA1A095 #Lab 65, -05, -02
hilited_back_color: 0xf04C4022 #Lab 25, -12, -12
hilited_candidate_back_color: 0xD7E8ED #Lab 92, 0, 10
hilited_candidate_text_color: 0x3942CB #Lab 50, 65, 45
hilited_candidate_label_color: 0x2566C6 #Lab 55, 45, 65
hilited_comment_text_color: 0x8144C2 #Lab 50, 65, -5
hilited_text_color: 0x2C8BAE #Lab 60, 10, 65
app_options:
com.apple.Spotlight:
ascii_mode: true
com.alfredapp.Alfred:
ascii_mode: true
com.runningwithcrayons.Alfred-2:
ascii_mode: true
com.blacktree.Quicksilver:
ascii_mode: true
com.apple.Terminal:
ascii_mode: true
no_inline: true
com.googlecode.iterm2:
ascii_mode: true
no_inline: true
org.vim.MacVim:
ascii_mode: true # 初始爲西文模式
no_inline: true # 不使用行內編輯
vim_mode: true # 退出VIM插入模式自動切換輸入法狀態
com.apple.dt.Xcode:
ascii_mode: true
com.barebones.textwrangler:
ascii_mode: true
com.macromates.TextMate.preview:
ascii_mode: true
com.github.atom:
ascii_mode: true
com.microsoft.VSCode:
ascii_mode: true
com.sublimetext.2:
ascii_mode: true
org.gnu.Aquamacs:
ascii_mode: true
org.gnu.Emacs:
ascii_mode: true
no_inline: true
co.zeit.hyper:
ascii_mode: true
com.google.Chrome:
# 規避 https://github.com/rime/squirrel/issues/435
inline: true
ru.keepcoder.Telegram:
# 規避 https://github.com/rime/squirrel/issues/475
inline: true