Skip to content

装机

sudo免密码

visudo 最后一行添加

1
chun ALL=(ALL) NOPASSWD:ALL

中文

1
2
3
4
apt install language-pack-zh-hant language-pack-zh-hans
apt install -y --force-yes --no-install-recommends fonts-wqy-microhei
apt install -y --force-yes --no-install-recommends ttf-wqy-zenhei
locale-gen

fcitx&rime输入法

1
2
3
apt install fcitx fonts-noto-cjk fonts-noto-color-emoji dbus-x11 fcitx-rime
fcitx >/dev/null 2>&1  # 启动fcitx
fcitx-config-gtk3 # 配置

默认简体中文,~/.config/fcitx/rime:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
switches:
  - name: ascii_mode
    reset: 0
    states: [ 中文, 西文 ]
  - name: full_shape
    states: [ 半角, 全角 ]
  - name: simplification
    reset: 1
    states: [ 漢字, 汉字 ]
  - name: ascii_punct
    states: [ 。,, ., ]

WSL

dbus生成ID

1
sudo systemd-machine-id-setup

/usr/share/fcitx/dbus/daemon.conf 找不到找/etc/dbus-1/

1
2
3
<listen>tcp:host=localhost,port=0</listen>
<auth>ANONYMOUS</auth>
<allow_anonymous/>

.bashrc:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
if [[ $OS =~ "wsl" ]]; then
    if [[ ! "$(ps -ef |grep fcitx)" =~\
        "/usr/bin/fcitx" ]]
    then
        export GTK_IM_MODULE=fcitx
        export QT_IM_MODULE=fcitx
        export XMODIFIERS=@im=fcitx
        export DefaultIMModule=fcitx
        fcitx-autostart>/var/log/fcitx/fcitx.log 2>&1
    fi
fi

推荐配合autohotkey,屏蔽热键

1
2
3
4
5
6
7
#IfWinActive, ahk_exe vcxsrv.exe
    ^Space::
    ControlSend, , ^{Space}
    Return
    ^!::
    ControlSend, , ^!
    Return