initial commit

This commit is contained in:
plasmaofthedawn
2025-07-01 23:49:35 -04:00
commit 6edaffcacb
4 changed files with 3262 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
confs
raw_tables
table

78
combine.py Normal file
View File

@@ -0,0 +1,78 @@
import subprocess
import os
header = """KeyCode=mnptkswljiueoaAR
Length=16
Prompt=
ConstructPhrase=
[Data]
"""
ucscr_header = """KeyCode=mnptkswljiueoa()[]{}^*.: -"
Length=16
Prompt=
ConstructPhrase=
[Data]
"""
def make_conf(name, filepath):
a = f"""[InputMethod]
Name=toki pona - {name}
LangCode=toki pona
Addon=table
Configurable=True
[Table]
File=table/{filepath}.dict
OrderPolicy=Fast
PageSize=10
ExactMatch={"True" if name != "UCSUR" else "False"}
[Table/PrevPage]
0=Page_Up
[Table/NextPage]
0=Page_Down
[Table/Selection]
0=F1
1=F2
2=F3
3=F4
4=F5
5=F6
6=F7
7=F8
8=F9
9=F10
"""
with open(f"confs/{filepath}.conf", "w") as f:
f.write(a)
try:
os.mkdir("raw_tables")
os.mkdir("table")
os.mkdir("confs")
except FileExistsError as e:
pass
names = [f"sitelen Kansi ({x})" for x in ["Tencent QQ", "sitelen munjan", "jan Josan", "jan Mato (jp)", "jan Mato (zh)", "jan U", "enervation", "jan lili", "StuleBackery", "sitelen Sonko pona", "WillBaneOfGods", "nasin pi kulupu Eko", "JoeStrout", "Evilkenevil77", "sitelen Sonwa", "sitelen Kanpun", "All"]] + ["UCSUR", "Toki Pona Script (dingbats)", "nasin pi sitelen jelo"]
filenames = ["toki_pona_" + x.replace(" ", "_").replace("(", "").replace(")", "").lower() for x in names]
data = open("data.txt").read()
for n, fn, d in zip(names, filenames, data.split("---")):
print(n, fn)
with open(f"raw_tables/{fn}.txt", "w") as f:
f.write(header if n != "UCSUR" and n != "nasin pi sitelen jelo" else ucscr_header)
f.write(d.strip())
subprocess.Popen(["libime_tabledict", f"raw_tables/{fn}.txt", f"table/{fn}.dict"])
make_conf(n, fn)

3160
data.txt Normal file

File diff suppressed because it is too large Load Diff

21
readme.md Normal file
View File

@@ -0,0 +1,21 @@
# hiiii
fcitx5 table based inputs for toki pona
adds a few dozen sitelen Kansi inputs (one for each column in https://sona.pona.la/wiki/sitelen_Kansi, as well as one that combines all of them)
as well as one for the UCSUR codepage, one for the emoji one (nasin pi sitelen jelo) and one for the dingbats one (called toki pona script)
emoji and UCSUR data was adapted from [ajemi](https://github.com/dec32/ajemi/tree/master)
# building
all the information for the tables are in that data text filee
running the combine.py script will sort it out into the dictionary and configuration files
# installation
copy all the files under the `confs` directory into `~/.local/share/fcitx5/inputmethod/` and all the files in the `table` dir into `~/.local/share/fcitx5/table/` dir