diff --git a/home/darwin/default.nix b/home/darwin/default.nix index c6cce09d..7214f57e 100644 --- a/home/darwin/default.nix +++ b/home/darwin/default.nix @@ -6,6 +6,7 @@ ./core.nix ./nushell.nix + ./rime-squirrel.nix ]; # Home Manager needs a bit of information about you and the diff --git a/home/darwin/rime-squirrel.nix b/home/darwin/rime-squirrel.nix new file mode 100644 index 00000000..07f94e59 --- /dev/null +++ b/home/darwin/rime-squirrel.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + # Squirrel Input Method + home.file."Library/Rime" = { + # my custom squirrel data (flypy input method) + source = "${pkgs.flypy-squirrel}/share/rime-data"; + recursive = true; + }; +} diff --git a/hosts/harmonica/default.nix b/hosts/harmonica/default.nix index e8b83645..8755749b 100644 --- a/hosts/harmonica/default.nix +++ b/hosts/harmonica/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ ... } @ args: ############################################################# # @@ -17,6 +17,8 @@ in ../../secrets/darwin.nix ]; + nixpkgs.overlays = import ../../overlays args; + networking.hostName = name; networking.computerName = name; system.defaults.smb.NetBIOSName = name; diff --git a/overlays/fcitx5/README.md b/overlays/fcitx5/README.md index 52ec51d6..a84e7c1a 100644 --- a/overlays/fcitx5/README.md +++ b/overlays/fcitx5/README.md @@ -1,14 +1,20 @@ -# Fcitx5-Rime + Flypy +# rime-data for flypy input method -- fcitx5 input method - currently not work in vscode, and failed to add flypy input method +Useful for Linux(fcitx5-rime) & macOS(squirrel). ## Hisotry Problems +## Linux(fcitx5-rime) + 1. pay attention to the `rm -rf .local/share/fcitx5/rime/`, which may contains some auto generated rime config files, which may cause flypy not the default scheme for rime 2. manage `~/.config/fcitx5/profile` in ../home/hyprland/default.nix, which hardcode rime as the default input method, so you do not need to use fcitx-configtool to set rime as the default input method. 3. fcitx5-rime still cannot use on vscode & chrome now... need more time to figure out why and resolve it. +## macOS(squirrel) + +1. pay attention to the `rm -rf ~/Library/Rime/`, which may contains some auto generated rime config files. + ## Docs about fcitx5 - [Fcitx5 - Arch Linux Wiki](https://wiki.archlinux.org/title/Fcitx5) diff --git a/overlays/fcitx5/default.nix b/overlays/fcitx5/default.nix index 543c1d2b..304dc0cd 100644 --- a/overlays/fcitx5/default.nix +++ b/overlays/fcitx5/default.nix @@ -7,4 +7,7 @@ # 我仅修改了 default.yaml 文件,将其中的半角括号改为了直角括号「 与 」。 rime-data = ./rime-data-flypy; fcitx5-rime = super.fcitx5-rime.override { rimeDataPkgs = [ ./rime-data-flypy ]; }; + + # used by macOS Squirrel + flypy-squirrel = ./rime-data-flypy; }) diff --git a/overlays/fcitx5/rime-data-flypy/share/rime-data/default.custom.yaml b/overlays/fcitx5/rime-data-flypy/share/rime-data/default.custom.yaml new file mode 100644 index 00000000..0eb61d5f --- /dev/null +++ b/overlays/fcitx5/rime-data-flypy/share/rime-data/default.custom.yaml @@ -0,0 +1,41 @@ +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 + + + diff --git a/overlays/fcitx5/rime-data-flypy/share/rime-data/default.yaml b/overlays/fcitx5/rime-data-flypy/share/rime-data/default.yaml index adfd8176..72ba43a2 100644 --- a/overlays/fcitx5/rime-data-flypy/share/rime-data/default.yaml +++ b/overlays/fcitx5/rime-data-flypy/share/rime-data/default.yaml @@ -1,4 +1,4 @@ -# 小鹤双拼自定义方案配置 +# Rime default settings # encoding: utf-8 config_version: "0.38" @@ -24,7 +24,7 @@ menu: page_size: 5 punctuator: - half_shape: &half_shape + full_shape: # replace full_shape with half_shape ',' : { commit: , } '.' : { commit: 。 } '<' : [ 《, 〈, «, ‹ ] @@ -53,17 +53,45 @@ punctuator: '_' : —— '+' : '+' '=' : '=' - # '[' : { commit: '【' } - # ']' : { commit: '】' } - # '{' : { commit: '{' } - # '}' : { commit: '}' } - # 直角空格更好看,改成它 - '[' : { commit: '「' } - ']' : { commit: '」' } - '{' : { commit: '『' } - '}' : { commit: '』' } - # 这个全宽字符非常恶心, 没啥用,老搞出全宽空格,禁用掉! - full_shape: *half_shape + '[' : [ 「, 【, 〔, [ ] + ']' : [ 」, 】, 〕, ] ] + '{' : [ 『, 〖, { ] + '}' : [ 』, 〗, } ] + + + half_shape: + ',' : { commit: , } + '.' : { commit: 。 } + '<' : [ 《, 〈, «, ‹ ] + '>' : [ 》, 〉, », › ] + '/' : { commit: 、 } + '?' : { commit: ? } + ';' : { commit: ; } + ':' : { commit: : } + '''' : { pair: [ '‘', '’' ] } + '"' : { pair: [ '“', '”' ] } + '\' : { commit: 、 } + '|' : '|' + '`' : '`' + '~' : { commit: ~ } + '!' : { commit: ! } + '@' : '@' + '#' : '#' + '%' : { commit: '%' } + '$' : { commit: "$" } + '^' : { commit: …… } + '&' : '&' + '*' : { commit: '*' } + '(' : ( + ')' : ) + '-' : '-' + '_' : —— + '+' : '+' + '=' : '=' + '[' : [ 「, 【, 〔, [ ] + ']' : [ 」, 】, 〕, ] ] + '{' : [ 『, 〖, { ] + '}' : [ 』, 〗, } ] key_binder: bindings: @@ -101,7 +129,7 @@ key_binder: - { 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: Shift+space, toggle: full_shape } - { when: always, accept: Control+period, toggle: ascii_punct } recognizer: diff --git a/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy.schema.yaml b/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy.schema.yaml index 341510c7..e8d65da5 100644 --- a/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy.schema.yaml +++ b/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy.schema.yaml @@ -4,7 +4,7 @@ schema: schema_id: flypy name: 小鹤音形 - version: "10.9.3" + version: "10.9.4" author: - 方案设计:何海峰 description: | @@ -160,4 +160,4 @@ menu: style: horizontal: true #竖排为false - + \ No newline at end of file diff --git a/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy_sys.txt b/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy_sys.txt index f9012735..a4978772 100644 --- a/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy_sys.txt +++ b/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy_sys.txt @@ -25,14 +25,14 @@ https://help.flypy.com/#/gn orm · ;y + ;u - ;i -* ;o -/ ;p +[ ;o +] ;p ! ;a …… ;s 、 ;d 《 ;g -[ ;h -] ;j +* ;h +/ ;j ( ;k ) ;l “ ;z @@ -73,7 +73,6 @@ https://help.flypy.com/#/gn orm 魅力 mwli 极为 jiww 按键 aj -不懂 bd 背景 bj 参加 cj 从前 cq @@ -131,6 +130,7 @@ https://help.flypy.com/#/gn orm 伤害 uh 世纪 uj 试试 uu +食物 uw 这次 vc 直到 vd 征服 vf @@ -338,7 +338,6 @@ https://help.flypy.com/#/gn orm 板上钉钉 budd 部队 budv 不施粉黛 bufd -备受关注 bugv 补救 bujq 不胜枚举 bumj 跋山涉水 buuu @@ -353,7 +352,6 @@ https://help.flypy.com/#/gn orm 背弃 bwqi 不外如是 bwru 百无一用 bwyy -百味杂陈 bwzi 报喜不报忧 bxby 巴西利亚 bxly 百依百顺 bybu @@ -383,7 +381,6 @@ https://help.flypy.com/#/gn orm 胆大妄为 ddww 大跌眼镜 ddyj 多多益善 ddyu -第二现场 dexi 达官贵人 dggr 蹬踏 dgta 电光石火 dguh @@ -1180,7 +1177,6 @@ https://help.flypy.com/#/gn orm 水银 uvyb 受制于人 uvyr 少之又少 uvyu -省委书记 uwuj 顺我者昌 uwvi 双喜临门 uxlm 蛇蝎心肠 uxxi @@ -1210,7 +1206,6 @@ https://help.flypy.com/#/gn orm 政权 vgqr 争执 vgvi 中规中矩 vgvj -周公之礼 vgvl 至高无上 vgwu 这个月 vgy 正义 vgyi @@ -1307,7 +1302,6 @@ https://help.flypy.com/#/gn orm 无理 wuli 忤逆 wuni 万水千山 wuqu -往事如烟 wury 无事生非 wuuf 巫山 wuuj 午睡 wuuv @@ -1338,7 +1332,6 @@ https://help.flypy.com/#/gn orm 惟有饮者留其名 wyym 心急 xbji 心理 xbli -性别歧视 xbqu 小不忍则乱大谋 xbrm 心比天高 xbtg 刑不上大夫 xbuf @@ -1414,7 +1407,6 @@ https://help.flypy.com/#/gn orm 瞎扯 xxie 新鲜出炉 xxil 相形见绌 xxji -小心谨慎 xxju 稀稀拉拉 xxll 寻寻觅觅 xxmm 心心念念 xxnn @@ -4088,7 +4080,6 @@ AA制 aav 默契 moq 默认 mor 模特 mot -模型 mox 灭顶 mpd 灭绝 mpj 孟婆汤 mpt @@ -6144,7 +6135,6 @@ AA制 aav 新版 xbb 信不过 xbg 想不开 xbk -心目 xbm 新闻 xbw 下次吧 xcb 下次见 xcj @@ -8001,7 +7991,6 @@ m³ otl 100 指挥 vhf 回忆 hyx 距离 jlw -食物 uwn 指示 vue 哲理 vlw 音形 yxk diff --git a/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy_user.txt b/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy_user.txt index c7955cd9..f8897612 100644 --- a/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy_user.txt +++ b/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy_user.txt @@ -16,6 +16,7 @@ # 用户词库,下行开始添加,编码格式见上,部署后生效 # 全码词 +杯子 bwzi 即使 jiui 回忆 hvyi 华为 hxww