Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a question on guix config #10

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
73 changes: 73 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,83 @@

* 常见的问题

** 怎样设置中文输入法
你可以选择使用 ~ibus~ 或者 ~fcitx~ 。

*** 设置 ~ibus~
1. 安装 ~ibus~ 和 ~ibus-rime~ (或 ~ibus-libpinyin~ )。
#+BEGIN_SRC shell
guix package -i ibus ibus-rime
1. 安装 ~ibus~ 和 ~ibus-libpinyin~ (或 ~ibus-rime~ )。 ~ibus-setup~ 在运行时依
赖 ~dconf~ ,所以你需要同时安装 ~dconf~ 。
#+BEGIN_SRC scheme
(operating-system
(packages (cons* ibus ibus-libpinyin dconf
%base-packages))
...
)
#+END_SRC

2. 设置以下的环境变量。bash用户添加到 =~/.profile= 文件里,zsh用户添加到
=~/.zprofile= 文件里。
#+BEGIN_SRC sh
export GTK_IM_MODULE="ibus"
export QT_IM_MODULE="ibus"
export XMODIFIERS="@im=ibus"
#+END_SRC

如果把 ~ibus~ 安装到system profile里,请设置以下的环境变量:
#+BEGIN_SRC sh
export GUIX_GTK2_IM_MODULE_FILE=/run/current-system/profile/lib/gtk-2.0/2.10.0/immodules-gtk2.cache
export GUIX_GTK3_IM_MODULE_FILE=/run/current-system/profile/lib/gtk-3.0/3.0.0/immodules-gtk3.cache
#+END_SRC
如果把 ~ibus~ 安装到user profile里,与上面类似,请设置这些环境变量(但是作者
没验证过是否可行):
#+BEGIN_SRC sh
export GUIX_GTK2_IM_MODULE_FILE=$HOME/.guix-profile/lib/gtk-2.0/2.10.0/immodules-gtk2.cache
export GUIX_GTK3_IM_MODULE_FILE=$HOME/.guix-profile/lib/gtk-3.0/3.0.0/immodules-gtk3.cache
#+END_SRC

注:
#+begin_quote
Guix里的GDM不会自动执行用户的login shell,所以 =~/.profile= 文件里的环境变
量在登录之后不会生效。推荐使用SDDM。
#+end_quote

3. 如果你曾经安装过 ~ibus~ ,请删除 =~/.cache/ibus= 这个文件夹。不匹配的
=~/.cache/ibus= 可能导致 ~ibus~ 无法启动。这是一个已知的bug。
#+BEGIN_SRC shell
rm -r ~/.cache/ibus
#+END_SRC

4. 运行 ~ibus-daemon --xim --replace --daemonize~ 以启动 ~ibus-daemon~ 。
#+BEGIN_SRC shell
ibus-daemon --xim --replace --daemonize
#+END_SRC

5. 运行 ~ibus-setup~ 进入设置图形界面,添加和设置输入法。
#+BEGIN_SRC shell
ibus-setup
#+END_SRC

6. 好了,你可以使用 ~ibus~ 来输入中文了。

*重要:*
#+begin_quote
如果 ~ibus~ 无法正常启动,请删除 =~/.cache/ibus= 之后再尝试一次。如果你更新了
~ibus~ 软件包,也需要删除 =~/.cache/ibus= 。这是一个已知的bug。
#+end_quote

*** 设置 ~fcitx~
@pmeiyu 不使用fcitx,此段略。
- [[https://guix-china.github.io/wiki/mirror/][Guix下载软件包太慢了,怎么使用镜像?]]
- [[https://guix-china.github.io/wiki/mirror/][~guix pull~ 太慢了,怎么使用镜像?]]
- [[https://guix-china.github.io/wiki/input-method/][怎么设置输入法?]]

** .config/guix/current 和 .guix-profile/ 有什么區別?
- .config/guix/current 里面只有 guix。它在 `guix pull` 之后指向最新的 guix.
- .guix-profile 里面含有用戶通過 `guix install` 安裝的軟件包。

* 贡献

- 你必须接受把你贡献的内容以下面的许可证发布。
Expand Down
10 changes: 10 additions & 0 deletions tips.org
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,13 @@ Guix源码仓库地址:
(name 'guix)
(url "/path/to/guix")))
#+END_SRC

** Epiphany 顯示中文爲方塊的解決辦法
在 Guix 1.1.0 的最近版本上(guix (GNU Guix)
636d573b7496d2b03670dd9db98b464141761fc6)中文網頁的中文顯示爲方塊,調整網頁字符
編碼也無法解決。通過 guix-bugs 郵件列表,我得到了方法:
#+begin_src shell
ln -s ~/.guix-profile/share/fonts ~/.fonts
#+end_src

然後重啓電腦。中文網頁就顯示正常了。