`
deepfuture
  • 浏览: 4331774 次
  • 性别: Icon_minigender_1
  • 来自: 湛江
博客专栏
073ec2a9-85b7-3ebf-a3bb-c6361e6c6f64
SQLite源码剖析
浏览量:79401
1591c4b8-62f1-3d3e-9551-25c77465da96
WIN32汇编语言学习应用...
浏览量:68340
F5390db6-59dd-338f-ba18-4e93943ff06a
神奇的perl
浏览量:101463
Dac44363-8a80-3836-99aa-f7b7780fa6e2
lucene等搜索引擎解析...
浏览量:281100
Ec49a563-4109-3c69-9c83-8f6d068ba113
深入lucene3.5源码...
浏览量:14594
9b99bfc2-19c2-3346-9100-7f8879c731ce
VB.NET并行与分布式编...
浏览量:65528
B1db2af3-06b3-35bb-ac08-59ff2d1324b4
silverlight 5...
浏览量:31304
4a56b548-ab3d-35af-a984-e0781d142c23
算法下午茶系列
浏览量:45181
社区版块
存档分类
最新评论

FreeBSD 8.1桌面安装Gnome2.3, 并使用ibus中文输入法

阅读更多
FreeBSD 8.1桌面安装Gnome2.3, 并使用ibus中文输入法
2010-11-06 12:57
光盘安装FreeBSD 8.1, Xorg, 和Gnome 2.3:

FreeBSD 8.1 DVD, 安装.
distribution选的all.
pakages选的Xorg meta port, 和 Gnome 2 meta port
50分钟左右安装完成

----------------------------------------------
设置网卡

1. ifconfig 找到网卡
2. 在/etc/rc.conf里面加
ifconfig_re0="inet 本机地址 netmask 掩码地址" #用你的网卡代替re0
defaultrouter=" 网关地址"
3. 在/etc/resolv.conf里面加
nameserver DNS的地址

重启动, 网络ok

---------------------------------------------------
设置Xorg和Gnome

1./etc/rc.conf里面加
hald_enable="YES"
dbus_enable="YES"
这样X11可以找到键盘鼠标
2. 运行
Xorg -configure
$home里面生成一个xorg.conf.new文件
3.测试Xorg -config xorg.conf.new -retro
会看到一个黑白格的桌面和中央一个X
用Ctrl-Alt- F1调出tty0, 按Ctrl-C退出X测试
4. 编辑xorg.conf.new文件, 在"Section Screen"区里, 加上DefaultDepth 24; 在SubSection Display区里, 加上Modes 屏幕宽x屏幕高. 像下面这样:
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1024x768"
EndSubSection
EndSection
5. copy编辑好的conf文件到指定位置:
cp xorg.conf.new /etc/X11/xorg.conf

X11 设置完成, 下面是Gnome设置

6. 如果之前没有使用其他的display manager, 这一步很简单:
在~/.xinitrc文件里加入:
/usr/local/bin/gnome-session
startx
gnome桌面就启动了

------------------------------------------------
安装文泉驿中文字体:
# whereis wqy
wqy: /usr/ports/x11-fonts/wqy
# cd /usr/ports/x11-fonts/wqy
# make install clean
15分钟左右ok

让X系统启动时载入字体。
编辑/etc/X11/xorg.conf
在Section "Files"里面加一行,FontPath "/usr/local/lib/X11/fonts/wqy"像下面这样
Section "Files"
ModulePath   "/usr/local/lib/xorg/modules"
FontPath     "/usr/local/lib/X11/fonts/misc/"
FontPath     "/usr/local/lib/X11/fonts/TTF/"
FontPath     "/usr/local/lib/X11/fonts/OTF"
FontPath     "/usr/local/lib/X11/fonts/Type1/"
FontPath     "/usr/local/lib/X11/fonts/100dpi/"
FontPath     "/usr/local/lib/X11/fonts/75dpi/"
FontPath     "/usr/local/lib/X11/fonts/wqy"
EndSection

--------------------------------------------------------------
安装ibus输入法

方法一:
pkg_add -r zh-ibus-pinyin
自动安装ibus和拼音输入法

方法二:
1 # pkg_add -r ibus 安装ibus
2 如下安装拼音输入法
# whereis ibus-pinyin
# ibus-pinyin: /usr/ports/chinese/ibus-pinyin
# cd /usr/ports/chinese/ibus-pinyin
# make install clean
需时约30分钟

设置启用ibus:
1.设置locale为UTF-8字符集
如果用csh或者tcsh, .cshrc 中增加
setenv LANG zh_CN.UTF-8
#桌面界面语言为中文 [如果remark掉,则桌面菜单等仍为英文]
setenv LC_CTYPE zh_CN.UTF-8
#locale的character type为UTF-8中文. [如果remark掉,将无法调出中文输入法]
setenv LC_ALL zh_CN.UTF-8
#暂不清楚,推测是locale各项设置改为中文 [remark掉无影响]

如果用sh, .shrc中增加 [如果用bash, .bashrc中增加]
export LANG=zh_CN.UTF-8
#桌面界面语言为中文 [如果remark掉,则桌面菜单等仍为英文]
export LC_ALL=zh_CN.UTF-8
#locale的character type为UTF-8中文. [如果remark掉,将无法调出中文输入法]
export LC_ALL=zh_CN.UTF-8
#暂不清楚,推测是locale各项设置改为中文 [remark掉无影响]

2.让ibus daemon随X一起启动
.xinitrc中增加
XIM=ibus
GTK_IM_MODULE=ibus
QT_IM_MODULE=xim
XMODIFIERS='@im=ibus'
XIM_PROGRAM="ibus-daemon"
XIM_ARGS="--daemonize --xim"

[参考一里有下面的说明, 这部分干啥用的?没照做也ok了]
.profile中添加
export LC_ALL=zh_CN.UTF-8

重启, startx, 在panel右击ibus图标->preferences->input method->select an input method->Chinese->pinyin, 点击Add, 点close.

ibus设置ok了.

参考一: http://alexshots.blog.163.com/blog/static/112112020108284599116/ [freebsd 8.1 如何安装中文拼音输入法ibus-pinyin]

参考二: ibus安装后的提示信息[after pkd_add -r ibus]:

ibus installation finished. To use ibus, please do the following:

If you are using bash, please add following lines to your $HOME/.bashrc:

export XIM=ibus
export GTK_IM_MODULE=ibus
export QT_IM_MODULE=xim
export XMODIFIERS=@im=ibus
export XIM_PROGRAM="ibus-daemon"
export XIM_ARGS="--daemonize --xim"

If you are using tcsh, please add following lines to your $HOME/.cshrc:

setenv XIM ibus
setenv GTK_IM_MODULE ibus
setenv QT_IM_MODULE xim
setenv XMODIFIERS @im=ibus
setenv XIM_PROGRAM ibus-daemon
setenv XIM_ARGS "--daemonize --xim"

If you are using KDE4, you may create a shell script in $HOME/.kde4/env,
and add following lines:

#!/bin/sh
export XIM=ibus
export GTK_IM_MODULE=ibus
export QT_IM_MODULE=xim
export XMODIFIERS=@im=ibus
export XIM_PROGRAM="ibus-daemon"
export XIM_ARGS="--daemonize --xim"

Following input methods/engines are available in ports:

chinese/ibus-chewing        Chewing engine for IBus
chinese/ibus-pinyin        The PinYin input method
japanese/ibus-anthy        Anthy engine for IBus
japanese/ibus-skk        SKK engine for IBus
textproc/ibus-kmfl        KMFL IMEngine for IBus framework
textproc/ibus-m17n        The m17n IMEngine for IBus framework
textproc/ibus-table        Table based IM framework for IBus

and QT4 input method module, textproc/ibus-qt.

If ibus cannot start or the panel does not appear, please ensure
that you are using up-to-date python.
There's a bug in python 2.5, which may prevent the panel from appearing.

------------------------------------
声卡驱动安装

1.先安装meta驱动试验:
# kldload snd_driver

检查是否有声音
# cat anyfile > /dev/dsp 有声音

然后查看驱动加载情况:
#cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 32bit 2009061500/i386)
Installed devices:
pcm0: <HDA Realtek ALC889 PCM #0 Analog> (play/rec) default
pcm1: <HDA Realtek ALC889 PCM #1 Analog> (play/rec)
pcm2: <HDA Realtek ALC889 PCM #2 Digital> (play)
pcm3: <HDA Realtek ALC889 PCM #3 Digital> (play)
pcm4: <HDA ATI RS690/780 HDMI PCM #0 HDMI> (play)

一般会显示出driver名字, 例如snd_ich. 但这里没有,好在根据HDA猜到了时snd_hda, 并且在FreeBSD说明里找到了snd_hda支持此Realtek ALC889
2. 修改 /boot/loader.conf
snd_hda_load="YES"

重启动无声, 然后
#cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 32bit 2009061500/i386)
Installed devices:
pcm0: <HDA ATI RS690/780 HDMI PCM #0 HDMI> (play) default
pcm1: <HDA Realtek ALC889 PCM #0 Analog> (play/rec)
pcm2: <HDA Realtek ALC889 PCM #1 Analog> (play/rec)
pcm3: <HDA Realtek ALC889 PCM #2 Digital> (play)
pcm4: <HDA Realtek ALC889 PCM #3 Digital> (play)
发现此时的pcm0跟Generic driver时不同了,变成了HDMI输出,由于音箱不在HDMI上,因此判断应该将default输出指定到现在的pcm1上

# sysctl hw.snd.default_unit=1
hw.snd.default_unit: 0 -> 1

检查是否有声音
# cat anyfile > /dev/dsp 有声音

3. 将此设置放到 /etc/sysctl.conf
hw.snd.default_unit=1
重启动ok

参考一:
http://forums.freebsd.org/archive/index.php/t-12517.html

参考二: snd_hda(4)
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics