Date: 06/20-06/26
In this week, I continued to read the source code of tmux-fingers to see how it initializes the finger-mode, then I could utilize the code to implement my rime mode.
My origin idea was:
tmux_rime.sh: rime mode script, responsible for initializing rime mode, drawing status bar, inserting text in tmux binding.sh: bind commands to keys and sent to the named pipe between with tmux-rime.shclient.py: called by tmux_rime.sh to request the server for current rime state and text that will be inserted server.py: interact with low-level rime library and send the results to client.py via socket
But later I found it's inefficient since almost all of keys must to process by the low-level rime library, that is, librime. However, they must be passed to tmux_rime.sh first, and client.py next. So, why do not send to client.py directly?
Here is my new idea:
tmux_rime.sh: rime mode script, responsible for initializing rime mode, drawing status bar, inserting text in tmux binding.sh: bind commands to keys and call client.py with argumentsclient.py: called by binding.sh and request the server for the current rime state and text that will be inserted, and send back the data via named pipe between with `tmux_rime.shserver.py: interact with low-level rime library and send the results to client.py via socket
I had set up the basic skeleton of client.py, it has a Argparser to parse arguments as commands like:
session_idsession_idsession_id, keycode, and modifier In the next week, I wish I can implement all necessary commands in both client and server and the socket part between them.