posts - 403, comments - 310, trackbacks - 0, articles - 7
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

[zz]一个很不错的Ubuntu配置帖子

Posted on 2007-09-09 10:52 ZelluX 阅读(683) 评论(0)  编辑  收藏 所属分类: Linux
发信人: laye (Addict to Goth >_<), 信区: Unix
标  题: 我的 Ubuntu 7.04 Cookbook
发信站: 日月光华 (2007年09月09日09:19:35 星期天), 站内信件

最近装了 Ubuntu 7.04,写了一个简单的 Cookbook,记录了自己遇到的一些问题和解决
方法,希望对大家有帮助。

cook01 中文字体美化

(1) 得到 simsun.ttc tahoma.ttf tahomabd.ttf  verdana.ttf verdanab.ttf
verdanai.ttf verdanaz.ttf 几个个字体文件 (可以从 Windows 的 Fonts 文件夹中获
取)
(2) 用 nautilus 打开系统的字体文件夹:nautilus fonts:///
(3) 将第 (1) 步中的几个个字体复制进第 (2) 步打开的字体文件夹中
(4) 创建 /etc/fonts/local.conf 文件,内容如 [附录1] (本文最底端)
(5) 重新启动 X: Ctrl + Alt + Backspace
(6) 打开 gnome 字体设置:gnome-font-properties,设置前四个字体为 Tahoma
(7) 打开 firefox 字体设置:将 Serif 设置为 SimSun,Sans-serif 设置为 Tahoma,
Monospace 设置为 SimSun,并且允许网页自由选择字体
(8) 重新启动 X, enjoy~

点评:该优化方案用 Windows 的 SimSun (衬线) 和 Tahoma (无衬线) 作为 UI 和
Web 中的主要字体使用。并且,解决了字体替换后的几个问题:
(1) 针对中文选字混乱问题 (同一句话中的不同汉字可能用不同字体进行渲染),我将所
有亚洲字符都强制使用 SimSun 显示。
(2) 由于 SimSun 的小字体为点阵字体,所以关闭了 8-17px 字体的抗锯齿以达到理想
的显示效果。
(3) 设置了 SimSun 和 Tahoma 的最小字体尺寸以保证显示效果

已知 Bug:  SimSun 英文和数字粗体效果不佳,可以下载网友制作的 SimSunbd 拷贝入
字体目录 (SimSunbd 的英文和数字用的好像是 Tahoma)


cook02 连接 windows 的远程桌面

安装 rdesktop:
sudo apt-get install rdesktop

使用:
rdesktop ip
rdesktop -f ip (全屏)


cook03 使 ntfs 分区可写

安装 ntfs-config:
sudo apt-get install ntfs-config

配置:
sudo ntfs-config
勾选两个选项 (或根据需要勾选)


cook04 访问 Windows 共享文件夹

执行:nautilus-connect-server
填写你要访问的 Windows 共享文件夹的相关信息,这个文件夹就会被 mount 到你的
Desktop 下。同样的方法可以 mount FTP 文件夹等等。


cook05 使 Windows 能访问 ubuntu 的文件 (samba)

执行:shares-admin
按需要设置


cook06 播放各种视频

(1) 下载 mplayer 的 Codec Package:
http://www.mplayerhq.hu/design7/dload.html#binary_codecs
(2) 将下载的 Codec Package 解压到 /usr/lib/win32
(3) 安装 mplayer 或各种 mplayer 的前端程序,我用的是 mplayer 的一个前端:
smplayer
(4) 如果你的 mplayer 的播放画面不正常,请检查你的 Video Output Driver 是否为
x11
(5) 若要显示中文字幕,需要在播放器内设置字幕用字体和字幕编码


cook07 使用 fcitx 替换 scim

由于使用习惯和兼容性原因,许多人不得不使用 fcitx,安装方法如下:

sudo apt-get install im-switch fcitx
im-switch -s fcitx -z default

如果你要在 en 的 locale 下使用 fcitx,请将 /etc/gtk-2.0/gtk.immodules 中的:

“xim” “X Input Method” “gtk20″ “/usr/share/locale” “ko:ja:th:zh”

替换为

“xim” “X Input Method” “gtk20″ “/usr/share/locale” “en:ko:ja:th:zh”



cook08 Panel 中的好东东

ubuntu 桌面上下各有一个 Panel。其实,我们可以自定义 Panel 上面的内容,比如说

天气预报,本本的电量显示、亮度调节,CPU 频率监视,系统负载监视,还有一个强制
终止程序的按钮 (Force Quit)等等。
你也可以把自己建立的 Laucher 拖动到 Panel 上,当然,你也可以在别的位置建立自
己的 Panel。


cook09 使用 HP 打印机

ubuntu 自带了 HP 系列打印机的驱动 oo2zjs,但奇怪的是,这个驱动居然是不能用的

用户需要卸载掉 ubuntu 自带的 oo2zjs,安装新的 oo2zjs。

具体过程如下:

确认编译环境已安装:
sudo apt-get install build-essential

下载 oo2zjs:
wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz

解压:
tar zxf foo2zjs.tar.gz
cd foo2zjs

卸载原有 foo2zjs:
make uninstall

编译,安装:
make
./getweb 1020 这里是你的打印机型号
sudo make install install-hotplug cups

在 ubuntu 的打印机管理中添加你的打印机 (不要选 suggest 的那个驱动):
sudo gnome-cups-manager

最后,重启 cups:
sudo make cups

cook10 开启 Vim 的“简易模式”

ubuntu 中 Vim 只有 console 的版本,且是传统 Unix 的行为模式,即在 INSERT
MODE 下,方向键和退格键是不起作用的。可以手动开启“类 Windows”模式,即在
COMMAND MODE 下输入:

:behave mswin


[附录1]

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

    <!-- use SimSun to display all Asia character -->
    <match target="font">
        <test compare="contains" name="lang" >
            <string>zh-cn</string>
            <string>zh-tw</string>
            <string>ja</string>
            <string>ko</string>
        </test>
        <edit name="family"><string>SimSun</string></edit>
    </match>

    <!-- open anti-alias for all font -->
    <match target="font" >
        <edit mode="assign" name="antialias"><bool>true</bool></edit>
        <edit mode="assign"
name="hintstyle"><const>hintslight</const></edit>
        <edit mode="assign" name="hinting"><bool>true</bool></edit>
        <edit mode="assign" name="autohint"><bool>false</bool></edit>
    </match>

    <!-- disable anti-alias for fonts between 8 to 17 pixels -->
    <match target="font" >
        <test compare="more_eq" name="pixelsize"
qual="any"><double>8</double></test>
        <test compare="less_eq" name="pixelsize"
qual="any"><double>17</double></test>
        <edit mode="assign" name="antialias"><bool>false</bool></edit>
    </match>

    <!-- set the minimum size for SimSun and Tahoma -->
    <match target="font" >
        <test name="family" qual="any">
            <string>SimSun</string>
            <string>NSimSun</string>
            <string>Tahoma</string>
        </test>
        <test compare="more_eq" name="pixelsize"><int>8</int></test>
        <test compare="less_eq" name="pixelsize"><int>12</int></test>
        <edit compare="eq" name="pixelsize"><int>12</int></edit>
    </match>

</fontconfig>




只有注册用户登录后才能发表评论。


网站导航: