红联Linux门户
Linux帮助
当前位置: 红联Linux门户 > SuSE

文本终端模式下中文输入法(Fcitx)配置(openSUSE Leap 42.1)

发布时间:2016-03-08 18:27:44来源:红联作者:sauntor
在文本模式下(ctrl+alt+f1~6),默认的xterm终端模拟器无法正常显示与输入中文,而现在fbterm是文本模式下非常棒的一款中文终端模拟器,此帖就是介绍中文输入法Fcitx和FBTerm在文本模式下的集成配置。
=========================
[list=1]
[*]软件安装[code]zypper in fbterm fcitx-fbterm noto-sans-cjksc
zypper in http://ftp.yzu.edu.tw/Linux/openSUSE/repositories/home:/tiwai/openSUSE_Leap_42.1/x86_64/fbv-0.0.6-1.1.x86_64.rpm
[/code][*]root用户配置[code]#vim /root/.bashrc
if [[ $(tty) == \/dev\/tty[0-9]* ]]; then
#可将下面的路径换成你喜欢的图片(须为JPG格式)
fbv "/usr/share/wallpapers/openSUSEdefault/contents/images/1920x1200.jpg"
export FBTERM_BACKGROUND_IMAGE=1
exec fbterm "$@"
fi
[/code][code]#vim /root/.fbtermrc
export TERM=fbterm
font-names=Source Code Pro,DejaVu Sans Mono,Noto Sans S Chinese,Droid Sans Fallback
font-size=14
text-encodings=UTF-8
input-method=fcitx-fbterm
fcitx -d &> /dev/null
[/code][*]普通用户配置[code]# vim ~/.bashrc
[[ $(tty) == \/dev\/tty[0-9]* ]] && {
#可将下面的路径换成你喜欢的图片(须是JPG格式的)
fbv "/usr/share/wallpapers/openSUSEdefault/contents/images/1920x1200.jpg"
export FBTERM_BACKGROUND_IMAGE=1
exec fcitx-fbterm-helper &> /dev/null
}
[/code][code]#vim ~/.fbtermrc
export TERM=fbterm
font-names=Source Code Pro,DejaVu Sans Mono,Noto Sans S Chinese,Droid Sans Fallback
font-size=14
text-encodings=UTF-8
input-method=fcitx-fbterm
[/code][code]sudo chmod u+s /usr/bin/fbterm
sudo usermod -a -G video $USER
[/code][/list]

参考连接
==========
openSUSE SDB:Fbterm
文章评论

共有 3 条评论

  1. sauntor 于 2016-03-16 23:56:06发表:

    其实所有可用的选项可以通过下面的方式查看:[code]fbterm --help
    [/code]此命令输出的选项中含有双横线(即:--)的选项都可作为.fbtermrc的配置项(须去掉双横线)。

  2. sauntor 于 2016-03-16 23:52:26发表:

    前面介绍的.fbtermrc配置文件有误,.fbtermrc支持的配置如下,其并不支持bash脚本(亦即与.bashrc不同,shell代码不会被执行),请参考下面的模板将不支持的选项/脚本去掉:[code]# Configuration for FbTerm

    # Lines starting with '#' are ignored.
    # Note that end-of-line comments are NOT supported, comments must be on a line of their own.


    # font family names/pixelsize used by fbterm, multiple font family names must be seperated by ','
    # and using a fixed width font as the first is strongly recommended
    font-names=inconsolata
    font-size=16

    # force font width (and/or height), usually for non-fixed width fonts
    # legal value format: n (fw_new = n), +n (fw_new = fw_old + n), -n (fw_new = fw_old - n)
    #font-width=
    #font-height=

    # default color of foreground/background text
    # available colors: 0 = black, 1 = red, 2 = green, 3 = brown, 4 = blue, 5 = magenta, 6 = cyan, 7 = white
    color-foreground=7
    color-background=0

    # max scroll-back history lines of every window, value must be [0 - 65535], 0 means disable it
    history-lines=1000

    # up to 5 additional text encodings, multiple encodings must be seperated by ','
    # run 'iconv --list' to get available encodings.
    text-encodings=

    # cursor shape: 0 = underline, 1 = block
    # cursor flash interval in milliseconds, 0 means disable flashing
    cursor-shape=0
    cursor-interval=500

    # additional ascii chars considered as part of a word while auto-selecting text, except ' ', 0-9, a-z, A-Z
    word-chars=._-

    # change the clockwise orientation angle of screen display
    # available values: 0 = 0 degree, 1 = 90 degrees, 2 = 180 degrees, 3 = 270 degrees
    screen-rotate=0

    # specify the favorite input method program to run
    input-method=

    # treat ambiguous width characters as wide
    #ambiguous-wide=yes
    [/code]

  3. MORR 于 2016-03-09 09:20:21发表:

    不错,受教了