有馬総一郎のブログ

(彼氏の事情)

2021年05月02日 23:50:15 JST - 3 minute read - Comments - Linux

Rust製のSKKサーバーyaskkserv2をインストールして今度こそ快適に使う

以前、 yaskkserv(Yet Another SKK server)でskkでの日本語入力を快適にする(はずが…)yaskkservを紹介したので、その続き、 yaskkserv2を紹介する。

インストール

$ git clone https://github.com/wachikun/yaskkserv2.git
$ cd yaskkserv2
$ cargo build --release
    Finished release [optimized] target(s) in 2m 21s
$ sudo cp -av target/release/yaskkserv2 /usr/local/sbin/
$ sudo cp -av target/release/yaskkserv2_make_dictionary /usr/local/bin/
$ yaskkserv2_make_dictionary --dictionary-filename=$HOME/.config/fcitx/skk/dictionary.yaskkserv2 /usr/share/skk/SKK-JISYO.L $HOME/Nextcloud/SKKFEP/skkuser8.txt 
Warning: CORRECTED! (DUPLICATE CANDIDATES) /home/arimasou16/Nextcloud/SKKFEP/skkuser8.txt:2184 "わたしh /私/[は/私/]/"    [47, 187, 228, 47, 91, 164, 207, 47, 187, 228, 47, 93, 47] -> [47, 187, 228, 47, 91, 164, 207, 47, 93, 47]
$ echo yaskkserv2 --google-cache-filename=$HOME/.config/fcitx/skk/yaskkserv2.cache $HOME/.config/fcitx/skk/dictionary.yaskkserv2 >> ~/.profile

これでOK!

rustupインストール

Rust製なのでcargo build --releaseできるようになってないと駄目。

あたりの手順を真似れば大丈夫だろう。

私は以前にalacrittyをインストールするために環境構築していたので、そのままcargo build --releaseできた。

$ sudo apt install cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev python3
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1
$ source $HOME/.cargo/env
$ rustup override set stable
$ rustup update stable

辞書作成

$ yaskkserv2_make_dictionary --dictionary-filename=~/.config/fcitx/skk/dictionary.yaskkserv2 /usr/share/skk/SKK-JISYO.L ~/Nextcloud/SKKFEP/skkuser8.txt 
Error: No such file or directory (os error 2)

yaskkserv2専用の辞書を作成するとき、ホームディレクトリを~で指定したら、そんなファイルないと言われたので$HOMEにした。

--utf8のオプションによるUTF-8辞書作成は、やはり tyru/eskk.vimfcitx-skkでは非対応だった。

インストールパス

$ cp -av target/release/yaskkserv2 /YOUR-SBIN-PATH/
$ cp -av target/release/yaskkserv2_make_dictionary /YOUR-BIN-PATH/

とあるが、/usr/bin/usr/local/bin/usr/sbinの使い分けを分かってなかったので、ここで確認。

「/bin」「/usr/bin」「/usr/local/bin」ディレクトリの使い分け | Linux技術者認定 LinuC | LPI-Japan

/usr/local

「RPMやdebなどのパッケージ管理システムによってシステムに管理されないコマンドやプログラム」

が置かれる。そしてsbin

システム管理用のコマンドやプログラムを置くディレクトリだという点が「bin」と異なります。

だそう。

起動コマンド

yaskkserv2 --google-cache-filename=$HOME/.config/fcitx/skk/yaskkserv2.cache $HOME/.config/fcitx/skk/dictionary.yaskkserv2

とした--google-japanese-inputのデフォルト値はnotfoundなので、特に指定しないで、キャッシュファイル指定だけとした。

~/.profile にコマンドを追記しているのは、やはりアプリケーション自動起動に登録にしてもfcitx-remote -rしないと有効にならなかったから。

.bashrc .bash_profile .profile の使い分けを分かってなかったので、ここで確認。

というか、ログイン時に .profile が読みこまれるなら、デスクトップ環境にログインしたときに起動する(だろう)fcitxより先に実行してくれそうだなぁ、という適当な勘でそうやってみた。正しくない用法かも知れない。が、目的は果たせてる。

Tags: Ubuntu Desktop SKK

NextcloudをWebDAVで利用する CLI Subsonic Client pSubを試す

comments powered by Disqus