my linux notepad

linux関連の備忘録です

ubuntu budgie 22.04 インストール後にすること(備忘録として)

firefoxにログイン

まずは自分の備忘録を見たり、いろいろと検索するためにまずブラウザを使えるようにする

rootユーザのパスワード

ubuntu はrootユーザの設定がされていないのでパスワードを決める

hoge@my-pc:~$ sudo su
[sudo] hoge のパスワード:
root@my-pc:/home/hoge# passwd
新しい パスワード:
新しい パスワードを再入力してください:
passwd: パスワードは正しく更新されました
root@my-pc:/home/hoge#

これでsudoとsuどちらもつかえるようになる

$ sudo   ※カレントディレクトリで一時的にroot権限を得る
$ su        ※カレントディレクトリはそのままでroot権限を得る
$ su -     ディレクトリはシステムルートに移動してroot権限を得る

$PATHの値は'sudo''su' 'su -' いずれも同じで使えるコマンドも変わらない

ACPIエラーの回避

マザーボード B75M-PLUS はACPIによるディスク類の制御に対応していないようなので、起動時にエラーメッセージが流れる

これを止めるためgrubの設定ファイルを編集する

# apt install vim
# vim /etc/default/grub


GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash libata.noacpi=1"
GRUB_CMDLINE_LINUX=""

grubをアップデートしてから再起動してエラーメッセージが表示されないことを確認する

# update-grub
# reboot

インプットメソッドの設定

デフォルトでインストールされているibus-mozcは正常に作動しないので、これを削除して代わりに fcitx5-mozcとfcitx5-kkcをインストールする

# apt remove ibus ibus-mozc
# apt autoremove
# apt install fcitx5 fcitx5-mozc fcitx5-kkc

いったんログアウトして再びログインすると、上パネルに fcitx5 のアプレットが表示されるようになる

fcitx5の設定をする

synaptic package manager のインストール

ubuntu budgie 22.04にはデフォルトでインストールされていないのでインストールする

# apt install synaptic

NVIDIAドライバーのインストール

推奨されるドライバーを調べる

hoge@my-pc:~$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001D01sv00001043sd000085F4bc03sc00i00
vendor : NVIDIA Corporation
model : GP108 [GeForce GT 1030]
driver : nvidia-driver-470-server - distro non-free
driver : nvidia-driver-535-server - distro non-free
driver : nvidia-driver-525 - distro non-free
driver : nvidia-driver-470 - distro non-free
driver : nvidia-driver-450-server - distro non-free
driver : nvidia-driver-418-server - distro non-free
driver : nvidia-driver-390 - distro non-free
driver : nvidia-driver-535 - distro non-free recommended
driver : nvidia-driver-545 - distro non-free
driver : nvidia-driver-525-server - distro non-free
driver : xserver-xorg-video-nouveau - distro free builtin

推奨されるドライバーはrecommendedと表示されるので、これをインストールする

# apt install nvidia-driver -535

NVIDIAドライバーのティアリング回避

このパソコンでは動画再生時に横にナイフで切ったような歪が生じる

これを修正するためには下のようにforce Composition Pipelineにチェックを入れて設定ファイル保存する必要がある

けれどもubuntu では設定ファイルを保存できない仕様になっていらしので、代わりに起動時にチェックを入れるシェルスクリプトを作り実行できるようにする

NVIDIA/トラブルシューティング - ArchWiki

ここを参考に作った1行の簡単なシェルスクリプト

#!/bin/bash
nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceCompositionPipeline = On }"

これを自動起動するアプリケーションに登録する

コマンドにシェルスクリプトディレクトリを指定し、名前と説明は任意に決めて保存する

再起動してnvidia-settingsの画面でforce Composition Pipelineにチェックが入っていることを確認する

ファンコントロールの設定

ハードウェアの互換性に問題があるためubuntu22.04 はマザーボードB75M-PLUS上の一部のセンサーしか検出できない。しかしi8kutilsをインストールすることで強制認識させることができる

それに必要なパッケージをインストールする

i8kutils についてはここを参考にした

devicetests.com

# apt install lm-sensors psensor fancontrol i8kutils

すべてのセンサーは検出できない前提で sensors-detect を実行する

# sensors-detect

sensors-detectを実行してできる設定ファイル/etc/modulesにi8kを追記する

# vim /etc/modules

# Generated by sensors-detect on Sat Jan 13 22:01:55 2024
# Chip drivers
coretemp
nct6775
i8k

/etc/modprobe.d/i8k.confを新規作成する

# vim /etc/modprobe.d/i8k.conf

options i8k force=1

再起動すると未検出のセンサーが検出されるはず

# reboot

再度 sensors-detect を実行したときの端末画面を示す

root@my-pc:/home/hoge# sensors-detect
# sensors-detect version 3.6.0
# Board: ASUSTeK COMPUTER INC. B75M-PLUS
# Kernel: 6.5.0-17-generic x86_64
# Processor: Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz (6/42/7)

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): y
Module cpuid loaded successfully.
Silicon Integrated Systems SIS5595...                                                    No
VIA VT82C686 Integrated Sensors...                                                         No
VIA VT8231 Integrated Sensors...                                                              No
AMD K8 thermal sensors...                                                                          No
AMD Family 10h thermal sensors...                                                         No
AMD Family 11h thermal sensors...                                                         No
AMD Family 12h and 14h thermal sensors...                                       No
AMD Family 15h thermal sensors...                                                         No
AMD Family 16h thermal sensors...                                                         No
AMD Family 17h thermal sensors...                                                         No
AMD Family 15h power sensors...                                                            No
AMD Family 16h power sensors...                                                            No
Hygon Family 18h thermal sensors...                                                     No
Intel digital thermal sensor...                                                                     Success!
    (driver `coretemp')                                  ※CPUのセンサーモジュールを検出
Intel AMB FB-DIMM thermal sensor...                                                     No
Intel 5500/5520/X58 thermal sensor...                                                   No
VIA C7 thermal sensor...                                                                               No
VIA Nano thermal sensor...                                                                         No

Some Super I/O chips contain embedded sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no): y
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor/ITE'...                                  No
Trying family `SMSC'...                                                                                 No
Trying family `VIA/Winbond/Nuvoton/Fintek'...                               Yes
Found `Nuvoton NCT5532D/NCT6779D Super IO Sensors'          Success!
    (address 0x290, driver `nct6775') マザーボードのセンサーモジュールを検出
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor/ITE'...                                  No
Trying family `SMSC'...                                                                                 No
Trying family `VIA/Winbond/Nuvoton/Fintek'...                               No
Trying family `ITE'...                                                                                      No

Some systems (mainly servers) implement IPMI, a set of common interfaces
through which system health data may be retrieved, amongst other things.
We first try to get the information from SMBIOS. If we don't find it
there, we have to read from arbitrary I/O ports to probe for such
interfaces. This is normally safe. Do you want to scan for IPMI
interfaces? (YES/no): y
Probing for `IPMI BMC KCS' at 0xca0...                                                 No
Probing for `IPMI BMC SMIC' at 0xca8...                                               No

Some hardware monitoring chips are accessible through the ISA I/O ports.
We have to write to arbitrary I/O ports to probe them. This is usually
safe though. Yes, you do have ISA I/O ports even if you do not have any
ISA slots! Do you want to scan the ISA I/O ports? (yes/NO): n

Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): y
Using driver `i2c-i801' for device 0000:00:1f.3: Intel Panther Point (PCH)

Next adapter: SMBus I801 adapter at f000 (i2c-0)
Do you want to scan it? (YES/no/selectively): y
Client found at address 0x50
Handled by driver `at24' (already loaded), chip type `spd'
    (note: this is probably NOT a sensor chip!)
Client found at address 0x51
Handled by driver `at24' (already loaded), chip type `spd'
    (note: this is probably NOT a sensor chip!)
Client found at address 0x52
Handled by driver `at24' (already loaded), chip type `spd'
    (note: this is probably NOT a sensor chip!)
Client found at address 0x53
Handled by driver `at24' (already loaded), chip type `spd'
    (note: this is probably NOT a sensor chip!)

Next adapter: NVIDIA i2c adapter 4 at 1:00.0 (i2c-1)
Do you want to scan it? (yes/NO/selectively): y

Next adapter: NVIDIA i2c adapter 5 at 1:00.0 (i2c-2)
Do you want to scan it? (yes/NO/selectively): y
Client found at address 0x4a
Probing for `National Semiconductor LM75'...                                   No
Probing for `National Semiconductor LM75A'...                                No
Probing for `Dallas Semiconductor DS75'...                                        No
Probing for `National Semiconductor LM77'...                                  No
Probing for `Analog Devices ADT7410/ADT7420'...                          No
Probing for `Analog Devices ADT7411'...                                          No
Probing for `Maxim MAX6642'...                                                    No
Probing for `Texas Instruments TMP435'...                                         No
Probing for `National Semiconductor LM73'...                                 No
Probing for `National Semiconductor LM92'...                                 No
Probing for `National Semiconductor LM76'...                                 No
Probing for `Maxim MAX6633/MAX6634/MAX6635'...                     No
Probing for `NXP/Philips SA56004'...                                                     No
Client found at address 0x4b
Probing for `National Semiconductor LM75'...                                 No
Probing for `National Semiconductor LM75A'...                              No
Probing for `Dallas Semiconductor DS75'...                                      No
Probing for `National Semiconductor LM77'...                                 No
Probing for `Analog Devices ADT7410/ADT7420'...                         No
Probing for `Analog Devices ADT7411'...                                             No
Probing for `Maxim MAX6642'...                                                              No
Probing for `Texas Instruments TMP435'...                                        No
Probing for `National Semiconductor LM92'...                                 No
Probing for `National Semiconductor LM76'...                                 No
Probing for `Maxim MAX6633/MAX6634/MAX6635'...                     No
Probing for `NXP/Philips SA56004'...                                                     No
Probing for `Analog Devices ADT7481'...                                             No

                                                             ※nvidiaモジュールは検出できない


Now follows a summary of the probes I have just done.
Just press ENTER to continue: 

Driver `nct6775':
  * ISA bus, address 0x290
    Chip `Nuvoton NCT5532D/NCT6779D Super IO Sensors' (confidence: 9)

Driver `coretemp':
  * Chip `Intel digital thermal sensor' (confidence: 9)

To load everything that is needed, add this to /etc/modules:
#----cut here----
# Chip drivers
coretemp
nct6775
#----cut here----
If you have some drivers built into your kernel, the list above will
contain too many modules. Skip the appropriate ones!

Do you want to add these lines automatically to /etc/modules? (yes/NO)y
Successful!

Monitoring programs won't work until the needed modules are
loaded. You may want to run '/etc/init.d/kmod start'
to load them.

Unloading cpuid... OK

root@my-pc:/home/hoge

pwmconfigを実行する

root@my-pc:~# pwmconfig
# pwmconfig version 3.6.0
This program will search your sensors for pulse width modulation (pwm)
controls, and test each one to see if it controls a fan on
your motherboard. Note that many motherboards do not have pwm
circuitry installed, even if your sensor chip supports pwm.

We will attempt to briefly stop each fan using the pwm controls.
The program will attempt to restore each fan to full speed
after testing. However, it is ** very important ** that you
physically verify that the fans have been to full speed
after the program has completed.

Found the following devices:
   hwmon0 is acpitz
   hwmon1 is coretemp
   hwmon2 is nct6779
   hwmon3 is dell_smm
   hwmon4 is asus
   hwmon5 is hidpp_battery_0
   hwmon6 is hidpp_battery_1

Found the following PWM controls:
   hwmon2/pwm1           current value: 159
hwmon2/pwm1 is currently setup for automatic speed control.
In general, automatic mode is preferred over manual mode, as
it is more efficient and it reacts faster. Are you sure that
you want to setup this output for manual control? (n) y
   hwmon2/pwm2           current value: 84
hwmon2/pwm2 is currently setup for automatic speed control.
In general, automatic mode is preferred over manual mode, as
it is more efficient and it reacts faster. Are you sure that
you want to setup this output for manual control? (n) y
   hwmon2/pwm3           current value: 255

Giving the fans some time to reach full speed...
Found the following fan sensors:
   hwmon2/fan1_input     current speed: 3341 RPM                   ※ケースファン
   hwmon2/fan2_input     current speed: 2048 RPM                   ※CPUファン
   hwmon2/fan3_input     current speed: 0 ... skipping!
   hwmon2/fan4_input     current speed: 0 ... skipping!
   hwmon2/fan5_input     current speed: 0 ... skipping!

Warning!!! This program will stop your fans, one at a time,
for approximately 5 seconds each!!!
This may cause your processor temperature to rise!!!
If you do not want to do this hit control-C now!!!
Hit return to continue: 

Testing pwm control hwmon2/pwm1 ...
  hwmon2/fan1_input ... speed was 3341 now 1000
    It appears that fan hwmon2/fan1_input
    is controlled by pwm hwmon2/pwm1 ※ケースファンの回転数とPWMの関係を調べる
Would you like to generate a detailed correlation (y)? y
    PWM 255 FAN 3383
    PWM 240 FAN 3284
    PWM 225 FAN 3176
    PWM 210 FAN 3061
    PWM 195 FAN 2909
    PWM 180 FAN 2789
    PWM 165 FAN 2652
    PWM 150 FAN 2509
    PWM 135 FAN 2372
    PWM 120 FAN 2205
    PWM 105 FAN 2057
    PWM 90 FAN 1901
    PWM 75 FAN 1748
    PWM 60 FAN 1578
    PWM 45 FAN 1409
    PWM 30 FAN 1245
    PWM 28 FAN 1203
    PWM 26 FAN 1169
    PWM 24 FAN 1151
    PWM 22 FAN 1128
    PWM 20 FAN 1107
    PWM 18 FAN 1079
    PWM 16 FAN 1059
    PWM 14 FAN 1036
    PWM 12 FAN 1007
    PWM 10 FAN 987
    PWM 8 FAN 954
    PWM 6 FAN 938
    PWM 4 FAN 905
    PWM 2 FAN 879
    PWM 0 FAN 824

  hwmon2/fan2_input ... speed was 2048 now 2048
    no correlation

Testing pwm control hwmon2/pwm2 ...
  hwmon2/fan1_input ... speed was 3341 now 3375
    no correlation
  hwmon2/fan2_input ... speed was 2048 now 976
    It appears that fan hwmon2/fan2_input
    is controlled by pwm hwmon2/pwm2 ※CPUファンの回転数とPWMの関係を調べる
Would you like to generate a detailed correlation (y)? y
    PWM 255 FAN 2048
    PWM 240 FAN 1973
    PWM 225 FAN 1872
    PWM 210 FAN 1804
    PWM 195 FAN 1741
    PWM 180 FAN 1634
    PWM 165 FAN 1578
    PWM 150 FAN 1527
    PWM 135 FAN 1483
    PWM 120 FAN 1422
    PWM 105 FAN 1320
    PWM 90 FAN 1261
    PWM 75 FAN 1196
    PWM 60 FAN 1134
    PWM 45 FAN 1071
    PWM 30 FAN 1013
    PWM 28 FAN 978
    PWM 26 FAN 981
    PWM 24 FAN 980
    PWM 22 FAN 983
    PWM 20 FAN 978
    PWM 18 FAN 976
    PWM 16 FAN 978
    PWM 14 FAN 982
    PWM 12 FAN 980
    PWM 10 FAN 978
    PWM 8 FAN 978
    PWM 6 FAN 981
    PWM 4 FAN 981
    PWM 2 FAN 980
    PWM 0 FAN 977


Testing pwm control hwmon2/pwm3 ...
  hwmon2/fan1_input ... speed was 3341 now 3366
    no correlation
  hwmon2/fan2_input ... speed was 2048 now 2054
    no correlation

No correlations were detected.
There is either no fan connected to the output of hwmon2/pwm3,
or the connected fan has no rpm-signal connected to one of
the tested fan sensors. (Note: not all motherboards have
the pwm outputs connected to the fan connectors,
check out the hardware database on http://www.almico.com/forumindex.php)

Did you see/hear a fan stopping during the above test (n)? n

Testing is complete.
Please verify that all fans have returned to their normal speed.

The fancontrol script can automatically respond to temperature changes
of your system by changing fanspeeds.
Do you want to set up its configuration file now (y)? y
What should be the path to your fancontrol config file (/etc/fancontrol)? 

Select fan output to configure, or other action:
1) hwmon2/pwm2           3) Change INTERVAL     5) Save and quit
2) hwmon2/pwm1           4) Just quit          6) Show configuration
select (1-n): 2                                                       ※ケースファンの制御を指定する

Devices:
hwmon0 is acpitz
hwmon1 is coretemp
hwmon2 is nct6779
hwmon3 is dell_smm
hwmon4 is asus
hwmon5 is hidpp_battery_0
hwmon6 is hidpp_battery_1

Current temperature readings are as follows:
hwmon0/temp1_input    27
hwmon0/temp2_input    29
hwmon1/temp1_input    33
hwmon1/temp2_input    26
hwmon1/temp3_input    27
hwmon1/temp4_input    28
hwmon1/temp5_input    24
hwmon2/temp1_input    26                      ※PsensorのSYSTINに対応する
hwmon2/temp2_input    24
hwmon2/temp3_input    106
hwmon2/temp4_input    106
hwmon2/temp5_input    107
hwmon2/temp6_input    21
hwmon2/temp7_input    31
hwmon2/temp8_input    0
hwmon2/temp9_input    0

Select a temperature sensor as source for hwmon2/pwm1:
 1) hwmon0/temp1_input
 2) hwmon0/temp2_input
 3) hwmon1/temp1_input
 4) hwmon1/temp2_input
 5) hwmon1/temp3_input
 6) hwmon1/temp4_input
 7) hwmon1/temp5_input
 8) hwmon2/temp1_input                        ※PsensorのSYSTINに対応する
 9) hwmon2/temp2_input
10) hwmon2/temp3_input
11) hwmon2/temp4_input
12) hwmon2/temp5_input
13) hwmon2/temp6_input
14) hwmon2/temp7_input
15) hwmon2/temp8_input
16) hwmon2/temp9_input
17) None (Do not affect this PWM output)
select (1-n): 8                ※ケースファンをSYSTIMの温度により制御する

Enter the low temperature (degree C)
below which the fan should spin at minimum speed (20): 30

Enter the high temperature (degree C)
over which the fan should spin at maximum speed (60): 50

Enter the PWM value (0-255) to use when the temperature
is over the high temperature limit (255): 


Select fan output to configure, or other action:
1) hwmon2/pwm2           3) Change INTERVAL     5) Save and quit
2) hwmon2/pwm1           4) Just quit          6) Show configuration
select (1-n): 1                 ※CPUファンの制御を指定する

Devices:
hwmon0 is acpitz
hwmon1 is coretemp
hwmon2 is nct6779
hwmon3 is dell_smm
hwmon4 is asus
hwmon5 is hidpp_battery_0
hwmon6 is hidpp_battery_1

Current temperature readings are as follows:
hwmon0/temp1_input    27
hwmon0/temp2_input    29
hwmon1/temp1_input    33                           ※Psensorの Package id 0 に対応する
hwmon1/temp2_input    27
hwmon1/temp3_input    27
hwmon1/temp4_input    28
hwmon1/temp5_input    23
hwmon2/temp1_input    26
hwmon2/temp2_input    24
hwmon2/temp3_input    107
hwmon2/temp4_input    107
hwmon2/temp5_input    107
hwmon2/temp6_input    22
hwmon2/temp7_input    31
hwmon2/temp8_input    0
hwmon2/temp9_input    0

Select a temperature sensor as source for hwmon2/pwm2:
 1) hwmon0/temp1_input
 2) hwmon0/temp2_input
 3) hwmon1/temp1_input                              ※Psensorの Package id 0 に対応する
 4) hwmon1/temp2_input
 5) hwmon1/temp3_input
 6) hwmon1/temp4_input
 7) hwmon1/temp5_input
 8) hwmon2/temp1_input
 9) hwmon2/temp2_input
10) hwmon2/temp3_input
11) hwmon2/temp4_input
12) hwmon2/temp5_input
13) hwmon2/temp6_input
14) hwmon2/temp7_input
15) hwmon2/temp8_input
16) hwmon2/temp9_input
17) None (Do not affect this PWM output)
select (1-n): 3                         ※CPUファンを Package id 0 の温度により制御する

Enter the low temperature (degree C)
below which the fan should spin at minimum speed (20): 30

Enter the high temperature (degree C)
over which the fan should spin at maximum speed (60): 70

Enter the PWM value (0-255) to use when the temperature
is over the high temperature limit (255): 


Select fan output to configure, or other action:
1) hwmon2/pwm2           3) Change INTERVAL     5) Save and quit
2) hwmon2/pwm1           4) Just quit          6) Show configuration
select (1-n): 5                         ※設定ファイル/etc/fancontrol を作成する

Saving configuration to /etc/fancontrol...
Configuration saved
root@my-pc:~# 

ファンコントロールを開始する

# systemctl start fancontrol
# systemctl enable fancontrol

設定ファイルを編集してファンコントロールを微調整する

# vim /etc/fancontrol

# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=10
DEVPATH=hwmon1=devices/platform/coretemp.0 hwmon2=devices/platform/nct6775.656
DEVNAME=hwmon1=coretemp hwmon2=nct6779
FCTEMPS=hwmon2/pwm1=hwmon2/temp1_input hwmon2/pwm2=hwmon1/temp1_input
FCFANS=hwmon2/pwm1=hwmon2/fan1_input hwmon2/pwm2=hwmon2/fan2_input
MINTEMP=hwmon2/pwm1=30 hwmon2/pwm2=30     ※この温度までファンはアイドリング
MAXTEMP=hwmon2/pwm1=50 hwmon2/pwm2=70     ※この温度でファンは最速回転
MINSTART=hwmon2/pwm1=10 hwmon2/pwm2=10   ※この値を小さくすることで回転の急上昇を抑えられる
MINSTOP=hwmon2/pwm1=0 hwmon2/pwm2=0          ※どちらのファンもPWM=0でも停止しない

ホームからデータフォルダにリンクを貼る(日本語版)

念のため trash-cli をインストールしてコマンドでゴミ箱にファイルを送れるようにする

# apt install trash-cli

次のようなシェルスクリプトを作成しておいて実行する

#!/bin/bash
## 前もって trash-cli をインストールしておく
## ディストリビューションによってフォルダ名が異なるので、その環境に合わせた名前に変更する
## 日本語フォルダ名同士の間隔は半角スペース
## データのディレクトリは環境に合わせて随時変更する
cd ~/
trash-put ダウンロード テンプレート ドキュメント ビデオ ピクチャ ミュージック 公開
ln -s /mnt/data/Downloads ダウンロード
ln -s /mnt/data/Templates テンプレート
ln -s /mnt/data/Documents ドキュメント
ln -s /mnt/data/Videos ビデオ
ln -s /mnt/data/Pictures ピクチャ
ln -s /mnt/data/Music ミュージック
ln -s /mnt/data/Public 公開

こうしてアイコンのデザインを保持したままリンクを貼ることができる



以上

Arch系linuxの日本語入力について


RebornOSをインストールした後、久々に日本語入力環境を整えようとしたら、けっこう手間取ったので、備忘録として残しておきたい。

特に設定ファイルの書き方と置き場所で迷わないようにしたい。

 

インプットメソッドはフレームワークとアドオンに分けると理解しやすいと思う。

フレームワークとしては fcitx5 や ibus が有名だ。

そして日本語入力用のアドオンはとしては mozc をはじめ anthy kkc skk などがある。どれも2023年現在 archlinux の正規リポジトリで更新されているようだ。

 

フレームワークのインストール

fcitx5 をフレームワークとして使用するには、パッケージグループ fcitx5-im をインストールする。

          # pacman -S fcitx5-im

fcitx5-im には fcitx5 fcitx5-configtool fcitx5-gtk fctx5-qt の4パッケージが含まれる。

ibusを選ぶ場合は、ibusをインストールする。同時にlibibusもインストールされる。

設定ツールはこれらの中に含まれているらしい。qtアプリケーションを動かすためにはibus-qt [AUR]を別途インストールするらしい。

          # pacman -S ibus

 

環境変数の設定

インプットメソッドを起動するためには環境変数の設定が必要だけれど、その設定ファイルの置き場所と書き方はひとつではないようだ。

自分なりに考えた結果、一番妥当なのはやはり /etc/environment に記述するのがいいと思う。

その理由は、XorgとWaylandの両方対応しているらしいこと。

それに1台のパソコンに2つのフレームワークを入れるとシステムが不安定になりそうで気持ちが悪いし、家族で同じパソコンを使う場合に、それぞれのホームディレクトリに設定ファイルを作るのも面倒。ならば /etc/environment にひとつだけ書いておこうというわけだ。

人によっては mozc が好きとか、kkc が好きとかはあるだろうけれど、それなら両方インストールして切替えて使えばいいだけのことだろう。

 

cinnamonのデフォルトエディタ xed で /etc/environment を編集する場合は、

       # xed /etc/environment

として、以下の内容を追記(コピペ)する。

                    GTK_IM_MODULE=fcitx
                    QT_IM_MODULE=fcitx
                    XMODIFIERS=@im=fcitx

ibusを使う場合は、変数の値を変更するだけ。

                    GTK_IM_MODULE=ibus
                    QT_IM_MODULE=ibus
                    XMODIFIERS=@im=ibus

ただし /etc/environment は環境変数を設定する専用ファイルなので、アプリを自動起動させることはできないらしい。

 

アドオンのインストール

アドオンとしてmozc を使用するなら fcitx5-mozc をインストールする。

          # pacman -S fcitx5-mozc

アドオンは複数インストールして切替えて使うこともできるので、試しに有名なアドオンをすべてインストールしてみるなら

          # pacman -S fcitx5-mozc fcitx5-anthy fcitx5-kkc fcitx5-skk

ibus用のアドオンとしては、ibus-anthy ibus-kkc ibus-skk がある。ibus-mozcはAURにある。

                 # pacman -S ibus-anthy ibus-kkc ibus-skk

 

好みのフレームワークとアドオンをインストールした後、一旦ログアウトして、再度ログインするとインプットメソッドが自動起動するはず。

自動的に起動しない場合は、自動起動するアプリとして登録する必要があるかもしれない。あるいは、設定ファイルに記述して自動起動させる方法もあるらしい。

cinnamonでfcitx5を起動させる場合は「設定」→「自動開始させるアプリ」で fcitx5 を登録しておけば確実に起動するだろう。

 

fcitx5の設定

最後にfcitx5の設定を行う。

図1のようにインプットメソッドのアイコンを右クリック→設定と進むと、 fcitx5の設定画面が開く(図2)。

図1

図2の右に表示されている Anthy Mozc SKK かな漢字 を矢印ボタン操作で左に移動させて適用ボタンを押す。

もしも目的のアドオンが見つからない場合は、「入力メソッドの検索」で見つかるかもしれない。今回はmozc がリストになくて焦った。

上下矢印ボタンでアドオンの優先順位を変更できるが、設定画面下方の注意事項のように「キーボード-日本語」を一番上に置く。

図2

OKボタンを押して設定を閉じてから、再度インプットメソッドのアイコンを右クリックすると、図3のようにアドオンの登録が完了したことがわかる。

こうしてアドオンをショートカットキーで切替えられるようになる。

図3


図4のように、ショートカットキーは設定画面のグローバルオプションで変更することができる。

デフォルトでは「Ctrl+スペース」で循環切替え、「全角/半角」で「キーボード-日本語」と直近使用のアドオンとの交互切替えになっている。

つまりmozcを使用している場合は、「全角/半角」を押すたびに日本語/英語が切換わる標準仕様となるはず。

図4


以上、cinnamonデスクトップでの fcitx5 を中心とした日本語入力の設定でした。