Skip to main content

米斯特周

Archlinux 2012.09.07 安装xfce4及设置

Table of Contents

上一篇日志说到了安装基本系统,本文接上文,安装XFCE4桌面环境,使用SLIM登录管理器,以及打开compiz特效。

# 一、声音

默认的,alsa已经被安装了,我们只需要安装其他需要的一些工具和pulseaudio即可,pulseaudio和alsa的关系,请看此文

pacman -S alsa-plugins alsa-utils pulseaudio libpulse pavucontrol

pavucontrol是音量控制程序,libpulse为一些程序提供pulseaudio音频输出功能。之后,使用alasmixer调整音量,M键禁音,调整好后,按Esc退出alsamixter。

alsactl store #存储调整后的音量
rc.d start alsa #启动alsa音频架构
speak-test -c 2 #测试是否有声音

# 二、显卡

因为我的显卡是低端的Nvidia显卡,所以我使用了nvidia driver for linux。显卡驱动好后,需要重启机器。

pacman -S nvidia nvidia-utils

# 三、安装Xorg

pacman -S xorg-server xorg-xinit xorg-server-utils pacman -S xf86-input-keyboard xf86-input-mouse #键盘,鼠标输入支持

# 四、配置Xorg

可以使用nvidia的工具生成Xorg.conf文件.

nvidia-xconfig -configura

# 五、安装字体,dbus,slim

pacman -S ttf-dejavu dbus gamin yaours -S wqy-microhei #从AUR源安装文泉驿微米黑
pacman -S acpid net-tools networkmanager slim #acpid电源管理守护进程,net-tools一些cli的网络工具,比如ifconfig,route,我们用networkmanager管理网络,slim登录管理器

# 六、配置daemons

编辑/etc/rc.conf,我的rc.conf文件内容如下:

# /etc/rc.conf – configuration file for initscripts #
# Most of rc.conf has been replaced by various other configuration
# files. See archlinux(7) for details. #
# For more details on rc.conf see rc.conf(5). #
DAEMONS=(syslog-ng acpid !network crond alsa dbus networkmanager slim)
LOCALE=”en_US.UTF-8″
# Storage #
# USEDMRAID=”no”
# USELVM=”no”
TIMEZONE=”Asia/Shanghai”
HARDWARECLOCK=”UTC”
USECOLOR=”yes”
# Network #

# interface=
# address=
# netmask=
# gateway=

!network表示此服务被disable了,服务之间用空格隔开,LOCALE在console下使用英文环境,TIMEZONE是时区设置,HARDWARECLOCK是硬件时钟,选用UTC时间。注意服务的顺序,networkmanagerslim必定在dbus之后。

# 七、安装Xfce4

pacman -S xfce4

默认安装全部即可。

# 八、修改.xinitrc

首先从/etc/skel中复制一份副本到home中,然后编辑该文件

cp /etc/skel/.xinitrc /home/abc

我的.xinitrc文件内容如下:

!/bin/sh
# # ~/.xinitrc
# # Executed by startx (run your window manager from here)
if [ -d /etc/X11/xinit/xinitrc.d ];
then for f in /etc/X11/xinit/xinitrc.d/*;
do [ -x “$f” ] && . “$f” done unset f
fi
export LANG=”zhCN.UTF-8″
export LCALL=”zh_CN.UTF-8″
exec dbus-launch –exit-with-session startxfce4

LANG和LC_ALL主要是桌面环境使用中文,注意exec这一段话,新版的SLIM很讨厌,如果按照官方的wiki去做,关机、重启、休眠等按钮是灰的,目前新版的SLIM用该exec命令就可以顺畅的使用xfce4。

接下来就安装一些其他的软件,比如输入法,浏览器等。

1.网页浏览

pacman -S firefox firefox-i18n-zh-cn pacman -S flashplugin libvdpau

2.输入法

yaourt -S fcitx fcitx-gtk2 fcitx-gtk3 fcitx-sunpinyin fcitx-configtool

3.多媒体

pacman -S gstreamer0.10 gstreamer0.10-bad gstreamer0.10-bad-plugins \
 gstreamer0.10-base gstreamer0.10-base-plugins gstreamer0.10-ffmpeg \
 gstreamer0.10-good gstreamer0.10-good-plugins gstreamer0.10-python \
 gstreamer0.10-ugly gstreamer0.10-ugly-plugins #安装解码器

pacman -S deadbeef gnome-mplayer yaourt -S ppstream

4.文字编辑

pacman -S gedit

5.文件管理

pacman -S gvfs-afc thunar-volman pacman -S thunar-archive-plugin file-roller unrar zip unzip p7zip

6.其他工具

pacman -S ristretto gimp #图像查看和编辑软件
pacman -S python2 python3 perl tk tcl cmake

7.即时聊天工具

yaourt -S pidgin pidgin-lwqq-git #pidgin+WebQQ
pacman -S xchat #IRC聊天工具

# 补充

1.networkmanger的桌面图标

pacman -S network-manager-applet

2.OFFICE工具可以选择永中office,下载地址这里,永中OFFICE自带PDF阅读器,当然如果你想使用adobe,evince等工具都可以。

3.Compiz3D效果,要求是显卡必须驱动。可以使用compiz-check脚本检查是否可以安装compiz。

yaourt -S compiz-check

如果环境检查都OK,那就可以安装compiz了。

pacman -S compiz-fusion #除了compiz-decorator-kde,compiz-fusion-plugins-extra以外,全部安装

完成之后,编辑~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml这个文件,我的文件内容如下:

<?xml version="1.0" encoding="UTF-8"?>
	<channel name="xfce4-session" version="1.0">
	<property name="general" type="empty">
		<property name="FailsafeSessionName" type="empty"/>
		<property name="SessionName" type="string" value="compiz"/>
		<property name="SaveOnExit" type="bool" value="false"/>
	</property>
	<property name="sessions" type="empty">
		<property name="Failsafe" type="empty">
			<property name="IsFailsafe" type="empty"/>
			<property name="Count" type="empty"/>
			<property name="Client0_Command" type="array">
			<value type="string" value="compiz"/>
			<value type="string" value="ccp"/>
		</property>
	<property name="Client0_PerScreen" type="empty"/>
	<property name="Client1_Command" type="empty"/>
	<property name="Client1_PerScreen" type="empty"/>
	<property name="Client2_Command" type="empty"/>
	<property name="Client2_PerScreen" type="empty"/>
	<property name="Client3_Command" type="empty"/>
	<property name="Client3_PerScreen" type="empty"/>
	<property name="Client4_Command" type="empty"/>
	<property name="Client4_PerScreen" type="empty"/>
	</property>
	</property>
	<property name="splash" type="empty">
		<property name="Engine" type="empty"/>
	</property>
	<property name="compat" type="empty">
		<property name="LaunchGNOME" type="bool" value="true"/>
	</property>
</channel>

按照我的文件修改一下。之后删除已经存在的会话:

rm -r ~/.cache/sessions

之后,打开compizconfig设置管理器,窗口装饰,命令中填入emerald –replace

我的xfce打开的效果有:最小化窗口,柔化窗口,水纹效果,渐隐窗口,窗口装饰,截屏,注解,窗口预览,JPEG,PNG,SVG,Text文件,Dbus,Inotify,会话管理,正则表达式配置,应用程序切换条,放置窗口,移动窗口,窗口规则,缩放,调整窗口大小。

4.假如想要ubuntu中的那个USB启动盘创建器,可以安装usb-creator,刻录工具用brasero

yaourt -S usb-creator yaourt -S brasero

5.使用完整版VIM,替换掉vi工具。

pacman -Rs vi #删除vi
pacman -S vim #安装VIM
ln -s /usr/bin/vim /usr/bin/vi #做一个vim的软链接
cp /usr/share/vim/vim73/vimrc_example.vim /etc/vimrc #将这个vimrc例子文件替换掉原来的vimrc文件。

6.字体配置文件的位置,for user。

/home/abc/.config/fontconfig/fonts.conf

其他内容随时附加。