Centos Redhat 7系统Xfce优化策略

Linux系统 0 2294 佚名 收藏

XFCE 桌面的配置

1. 安装必要软件包

yum install epel-release -y
yum groupinstall "Server with GUI" -y
yum groupinstall "Xfce" -y
yum grouplist hidden

如果 Fonts 没安装

yum groupinstall "Fonts"

安装字体包

$ fc-list :lang=zh-cn

可以看到当前已经安装的中文字体

yum groupinstall "Compatibility Libraries"
yum install libX11.i686 -y

2. 配置默认 target

#systemctl set-default graphical.target
#systemctl get-default
#systemctl isolate graphical.target

3. 禁用本机防火墙和 selinux

[root@ctsh ~]# vi /etc/selinux/config
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@ctsh ~]# systemctl stop firewalld
[root@ctsh ~]# systemctl disable firewalld

4. 配置 lightdm

先要禁用 gdm

#systemctl stop gdm
#systemctl disable gdm

配置 lightdm

#vi /etc/lightdm/lightdm.conf
[XDMCPServer]
enabled=true
port=177
#systemctl enable lightdm
#systemctl start lightdm

5. 删除无关的软件包(版本可能不一样)

gnome-packagekit-3.28.0
mate-screensaver-1.16.1-1.el7.x86_64 
gnome-screensaver-3.6.1-20.el7.x86_64
gnome-user-docs-3.28.2-1.el7.noarch

# yum remove gnome-packagekit-3.28.0
#yum remove gnome-user-docs
#yum remove gnome-screensaver

6. 给 gnome 桌面增加右键 Terminal 菜单(xfce 默认存在)

#yum install nautilus-open-terminal

7. 配置 latency-performance,保障系统是低延迟模式。

桌面服务器,一般都要求快速反应。

# yum update
# yum install tuned
# systemctl start tuned 
# systemctl enable tuned
#tuned-adm profile latency-performance
#tuned-adm active

验证 latency-performance 已经生效

8. 配置 dbus 相关

/etc/security/limits.conf

在文件末尾添加:

* soft nofile 65535
* hard nofile 65535
# cd /etc/security/limits.d/
# cat 20-nproc.conf 
* soft nproc 65535
* soft nofile 65535
root soft nproc unlimited

否则会出现 dbus 为 100%的情况,但是 20-nproc.conf 这里的*,如果配置为 65535 也会有

其他影响,可能某个用户,开启太多经常,导致服务器异常。默认是 4096。

查看是否生效:

# ps aux|grep gnome-terminal
guanghui 15758 0.8 0.1 709068 28448 ? Sl 08:54 0:00 
/usr/libexec/gnome-terminal-server
root 15804 0.0 0.0 112820 984 pts/0 S+ 08:54 0:00 grep --color=auto 
gnome-terminal
# cd /proc/15758
# cat limits 
Limit Soft Limit Hard Limit Units 
Max processes 4096 4096 processes 
Max open files 65535 65535 files

9. 一些其他设置

a. 禁止 lightdm 在登录的时候显示所有 User,默认是允许的

#vi /etc/lightdm/lightdm.conf
[Seat:*]
#type=local
greeter-hide-users=true

b. 配置右键 Terminal 打开后的默认目录

# vi /etc/xdg/Thunar/uca.xml
<command>exo-open --working-directory %d --launch TerminalEmulator</command>

这里修改默认 %f 为 %d

c. 配置默认的 terminal 为 Gnome-terminal

#vi /etc/xdg/xfce4/helpers.rc
WebBrowser=chromium-browser
MailReader=thunderbird
TerminalEmulator=gnome-terminal
FileManager=Thunar

d. 配置键盘快捷键(避免跟 eod/etx 等其他有快捷键的冲突,比如 P 键/Tab 键)

#vi /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml

删除两个属性

<property name="&lt;Super&gt;p" type="string" value="xfce4-display-settings --minimal"/>

<property name="&lt;Super&gt;Tab" type="string" value="switch_window_key"/>

e. Xfce policykit agent 错误

1.jpg

解决 1:

#cd /etc/xdg/autostart/
#mv /etc/xdg/autostart/xfce-polkit.desktop xfce-polkit.desktop.bak

解决 2:

#yum update

升级当前系统所有软件包到最新,也能得到解决(怀疑是某些跟 xfce-polkit 包相关的其他

包,没有升级导致的)

10. 设置 XFCE 作为主要桌面

#cd /usr/share/xsessions
#mkdir bak
#mv gnome* bak/
#mv mate* bak/

11. Group icons on Panel 显示设置

比如我开了多个 Terminal,每个都在 panel 上,不方便。但是,放一起,再通过下拉菜单就

可以更加整洁了。

RightClick on Panel –>Panel-->Panel Prferences-->Items-->Windows Bottons--> 点击扳

手的小图标—Behaviour--> Window grouping—Always.

2.jpg

也可以通过配置文件 xfce4-panel.xml 修改:

 <property name="plugins" type="empty">
 <property name="plugin-1" type="string" value="applicationsmenu"/>
 <property name="plugin-2" type="string" value="actions"/>
 <property name="plugin-3" type="string" value="tasklist">
 <property name="grouping" type="uint" value="1"/>
 </property>
 <property name="plugin-15" type="string" value="separator">

本文地址:https://www.fasteda.cn/post/252.html  文章归属于原作者,转载请注明


相关推荐:

网友留言:

您需要 登录账户 后才能发表评论

我要评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
验证码