This commit is contained in:
js0ny 2026-01-16 04:33:02 +00:00
parent 8ae3449525
commit e963c7fb74
3 changed files with 128 additions and 10 deletions

View file

@ -125,10 +125,10 @@
app-id = "^anki$"; app-id = "^anki$";
title = "^Add$"; title = "^Add$";
} }
# Dolphin compressing files # Dolphin file operations
{ {
app-id = "^org.kde.dolphin$"; app-id = "^org.kde.dolphin$";
title = "^Compressing.*$"; title = "^(Copying|Compressing).*$";
} }
{ {
app-id = "^thunar$"; app-id = "^thunar$";

View file

@ -32,6 +32,7 @@
audio = [ audio = [
"audio/flac" "audio/flac"
"audio/vnd.wave" # .wav "audio/vnd.wave" # .wav
"audio/x-vorbis+ogg" # .ogg
]; ];
browser = [ browser = [
"text/html" "text/html"

View file

@ -1,4 +1,8 @@
{pkgs, ...}: let {
pkgs,
lib,
...
}: let
version = "v13.3.12"; version = "v13.3.12";
rimeWanxiang = pkgs.fetchzip { rimeWanxiang = pkgs.fetchzip {
url = "https://github.com/amzxyz/rime_wanxiang/releases/download/${version}/rime-wanxiang-zrm-fuzhu.zip"; url = "https://github.com/amzxyz/rime_wanxiang/releases/download/${version}/rime-wanxiang-zrm-fuzhu.zip";
@ -64,13 +68,15 @@
cp -r ${rimeWanxiang} $out cp -r ${rimeWanxiang} $out
chmod -R u+w $out chmod -R u+w $out
# Modify custom_phrase.txt: replace the third line # # Modify custom_phrase.txt: replace the third line
if [ -f $out/custom_phrase.txt ]; then # if [ -f $out/custom_phrase.txt ]; then
sed -i '3c\test\tt\t50' $out/custom_phrase.txt # sed -i '3c\test\tt\t50' $out/custom_phrase.txt
else # else
# If the file doesn't exist, create it with the desired content # # If the file doesn't exist, create it with the desired content
echo -e "# Line 1\n# Line 2\ntest\tt\t50" > $out/custom_phrase.txt # echo -e "# Line 1\n# Line 2\ntest\tt\t50" > $out/custom_phrase.txt
fi # fi
# Define custom phrases below
rm -f $out/custom_phrase.txt
# Merge rime files # Merge rime files
cp -r ${rimeCantoneseFiltered}/* $out/ cp -r ${rimeCantoneseFiltered}/* $out/
@ -166,5 +172,116 @@ in {
''; '';
enable = true; enable = true;
}; };
# 感觉用 custom_phrase.txt 更方便一些,用 user.dict.yaml 需要去 base.dict.yaml 里找字
# 而且适合纯粹汉语拼音输入,不适合通过有独特含义的外文来输入汉字
"${rimePath}/custom_phrase.txt" = {
text = builtins.replaceStrings ["\\t"] ["\t"] ''
#给自定义用户词扩展一个换行:\n, 制表符:\t, 回车符:\r, 空格:\s
nixos\tNixOS\t1000
\tgozu\t1000
\txvpoerborvya\t1000
\thyperborea\t1000
\tsugeljdidi\t1000
\thvgevuyi\t1000
\tlpdptcyt\t1000
\tklpimk\t1000
\tkepi\t1000
\tbonabavuyi\t1000
\thwuaqu\t1000
\thwuaqv\t1000
\taaerhjgeersike\t1000
\tluslniya\t1000
\truthenia\t1000
\tkaerbaqm\t1000
\twoliniya\t1000
西\tqxerkexiya\t1000
\taasitelahj\t1000
\tytjibx\t1000
\tytjibxhj\t1000
\tuzbek\t10
\tdezo\t1000
\tjxkejptr\t1000
\tuegedh\t1000
\tmavini\t1000
\tmazzini\t1000
\tfatrvuyi\t1000
西\tfaxisidayihv\t1000
\thljmlmbh\t1000
\tvkvktmmy\t1000
\ttmdymyyp\t1000
\ttmdymyyplp\t1000
\tkesitjdyniye\t1000
\tataturk\t1000
-\thabusibkloln\t1000
\twzmagshego\t1000
\thohgsolp\t1000
\thohenzollern\t1000
\tmzsluimite\t1000
\tlixitehoff\t1000
西\tandaluxiya\t1000
西\tandalucia\t1000
\tvhzoxd\t1000
\tvhjyhv\t1000
\tluujugmy\t1000
麿\tjnwzwfmo\t1000
麿\tjnwzwfmi\t1000
麿\tjnwzwfmaro\t1000
\tdavgyizjhv\t1000
\tbahsyiyp\t1000
\tvkhewzxn\t1000
\tgrteyj\t1000
\tgrdsjptebxdayjxi\t1000
\tgrteyj\t900
\tlyuiuvvf\t1000
\tuvvf\t1000
\tjmbk\t1000
\tjqjqjmbk\t1000
\tjmgs\t1000
\tjqqijmgs\t1000
\tjmhs\t1000
\tmallvihu\t1000
\tpyherh\t1000
\txczevisjlh\t1000
\ttsvipl\t1000
\theljdiya\t1000
\thollandia\t1000
\tDD\t1000
\tCL\t1000
\tCA\t1000
\tBB\t1000
\tCV\t1000
\tSS\t1000
\tFF\t1000
\tBJT\t1000
\tFET\t1000
MOS\tMOSFET\t1000
\tyhluvijc\t1000
\tbalatro\t1000
\tujhllvtj\t1000
'';
# 词序有点问题10 也比默认词典的高,感觉得换成 user.dict.yaml
# 仏\tfo\t10
# 広东\tgdds\t10
# 広州\tgdvb\t10
# 広西\tgdxi\t10
# 仏山\tfouj\t10
enable = true;
};
# 一个用 user.dict.yaml 格式写的词典样例,写起来太麻烦了,作者似乎也没弄转换器
"${rimePath}/user.dict.yaml" = {
text = ''
# vim:noexpandtab
# rime dictionary
# encoding: utf-8
---
name: misc
version: "LTS"
sort: by_weight
...
hā;kh jī;tq mǐ;dd 1000
wū;pa jiǎo;dy shā;yu 1000
wēn;dw dū;ev ěr;xd hán;dg 1000
'';
};
}; };
} }