Linux中安装使用RXVT命令行终端窗口程序的教程,linuxrxvt


rxvt 是一个功能强大的的终端,它占用资源少,启动速度快,很多人都喜欢使用它。所以我在这里介绍一下Debian系统中rxvt中文终端的安装。在 Debian中有很多个rxvt包,可用apt-cache search rxvt命令查询。主要有以下三类,一个就叫rxvt,不支持中文显示;一个叫rxvt-ml,支持GB和BIG5中文编码;还有一个叫rxvt- unicode,支持unicode编码。第一种不支持中文,这里就不讨论了。下面分别讨论rxvt-ml和rxvt-unicode两种rxvt终端的安装。
在使用rxvt中文终端前,需先把GNOME或KDE桌面的中文环境配置好。这样才能在rxvt中正常显示中文和使用中文输入法(我用fcitx)。

安装rxvt-ml
这里我们以debian系的Linux为例:

代码如下:apt-get install rxvt-ml
安装完成后,在/usr/bin目录下会生成几个rxvt程序,分别是crxvt crxvt-big5 crxvt-gb grxvt krxvt 和一个指向/etc/alternatives/rxvt的链接文件rxvt。这六个程序分别对应不同的语言编码环境,crxvt-gb用于中文GB编码环境;crxvt-big5用于大五码编码环境;krxvt用于日文环境,我测试过,krxvt也可用于中文环境;grxvt用于greek键盘环境; crxvt也是用于大五码环境;rxvt链接默认指向krxvt。
对于我们来说,只需使用crxvt-gb这个程序就可以了。为了能正常显示中文,我们需把locale环境配置成zh_CN.GB2312。具体配置方式可参见GNOME和KDE桌面环境中的locale配置。重启X会话使 locale生效,这样就可用crxvt-gb使用rxvt中文终端了。


个人的配置文件配置示例:

代码如下:
!!$HOME/.Xdefaults
Rxvt.preeditType: root</p> <p>!!窗口大小及标题
Rxvt.geometry: 80x25
Rxvt.title: hutaow-rxvt</p> <p>!!输入法设置
Rxvt.inputMethod: fcitx</p> <p>!!透明度设置
!Rxvt.transparent: true
!Rxvt.shading: 110
!Rxvt.tintColor: grey
!Rxvt.inheritPixmap: false</p> <p>!!扩展设置
Rxvt.perl-ext-common: default, matcher, fullscreen</p> <p>!!URL操作
Rxvt.urlLauncher: /usr/bin/chromium
Rxvt.matcher.button: 1</p> <p>!!标签设置
!Rxvt.per-ext-common: ..., tabbed, ...
!Rxvt.tabbed.tabbar-fg: 2
!Rxvt.tabbed.tabbar-bg: 0
!Rxvt.tabbed.tab-fg: 3
!Rxvt.tabbed.tab-bg: 0
!Rxvt.tabbed.new-button: false
!Rxvt.tabbed.autohide: true
!RXvt.tabbed.reopen-on-close: no
!Rxvt.keysym.Control-t: perl:tabbedex:new_tab
!Rxvt.keysym.Control-Tab: perl:tabbedex:next_tab
!Rxvt.keysym.Control-Shift-Tab: perl:tabbedex:prev_tab
!Rxvt.keysym.Control-Shift-Left: perl:tabbex:move_tab_left
!Rxvt.keysym.Control-Shift-Right: perl:tabbex:move_tab_right
!Rxvt.keysym.Control-Shift-R: perl:tabbex:rename_tab</p> <p>!!全屏模式
!Rxvt.perl-ext-common: ..., fullscreen, ...
Rxvt.keysym.F11: perl:fullscreen:switch</p> <p>!!滚动条设置
Rxvt.scrollBar: true
Rxvt.scrollBar_right: true
Rxvt.scrollBar_floating: false
Rxvt.scrollstyle: plain</p> <p>!!滚屏设置
Rxvt.mouseWheelScrollPage: false
Rxvt.scrollTtyOutput: false
Rxvt.scrollWithBuffer: true
Rxvt.scrollTtyKeypress: true</p> <p>!!光标闪烁
Rxvt.cursorBlink: true</p> <p>!!缓存行数
Rxvt.saveLines: 5000</p> <p>!!边框设置
Rxvt.borderLess: false</p> <p>!!字体设置
Rxvt.dpi: 96
Rxvt.*font: xft:Terminus,xft:WenQuanYi Bitmap Song</p> <p>!!颜色设置
Rxvt.depth: 32
Rxvt.background: #2C2C2C
Rxvt.foreground: 7
Rxvt.colorBD: 7
Rxvt.colorUL: 7</p> <p>!!基本颜色
!Black
Rxvt.color0: #3F3F3F
Rxvt.color8: #709080
!red
Rxvt.color1: #705050
Rxvt.color9: #DCA3A3
!Green
Rxvt.color2: #60B48A
Rxvt.color10: #72D5A3
!Yellow
Rxvt.color3: #DFAF8F
Rxvt.color11: #F0DFAF
!Blue
Rxvt.color4: #9AB8D7
Rxvt.color12: #94BFF3
!Magenta
Rxvt.color5: #DC8CC3
Rxvt.color13: #EC93D3
!Cyan
Rxvt.color6: #8CD0D3
Rxvt.color14: #93E0E3
!White
Rxvt.color7: #DCDCDC
Rxvt.color15: #FFFFFF

配置后的终端运行效果如下图:
201677121325883.png (663×429)

相关内容