Linux系统美化教程(Ubuntu和CentOS)
1.界面美化
1.1 安装工具
-
安装扩展源
yum install -y epel-release
-
安装字体包
yum -y install liberation-mono-fonts
-
安装gnome-menis标准菜单(通常已经安装)
yum -y install gnome-menus
-
安装gnome个性化工具
yum -y install gnome-tweak-tool
-
安装桌面管理器(通常已经安装)
yum -y gnome-shell
-
执行完上述命令后,需要重启一下客户机
1.2 下载主题跟图标
-
下载地址,我放在百度云中,有两个主题都可以试试
-
链接:https://pan.baidu.com/s/1isfCBqjcqUGXmvaIWnPjUQ
提取码:jpa4 -
将文件解压后,主题文件放在下面这个目录
/usr/share/thems
-
图标跟光标文件放在这个目录
/usr/share/icons
-
放置完毕后,打开刚刚安装好的gnome-tweak-tool工具,在扩展中,打开User themes
-
再打开外观,然后在主题和图标栏中选择刚刚下载的主题和图标文件
1.3 使用dash-to-dock
-
先在官网下载
http://micheleg.github.io/dash-to-dock/index.html
-
要注意dash-to-dock要跟gnome-shell版本一致,使用以下命令查看:
gnome-shell --version
-
根据自己的gnome-shell版本去官网找对应的dash版本下载
-
下载后使用快捷键CTRL + H 打开/home/usename/文件夹下的隐藏文件夹
-
然后将下载的文件解压到~/.local 隐藏文件夹中
unzip [email protected] -d ~/.local/share/gnome-shell/extensions/[email protected]/
-
紧接着重启客户端,这样可以在gnome-tweak-tool工具中的扩展那一栏中可以看到dash-to-dock,然后打开它
2.终端美化
2.1 使用zsh
-
安装,centos,只需要修改apt-get为yum
sudo apt-get install -y zsh
-
查看系统支持的shell
cat /etc/shells
-
切换到zsh,如果想让root用户也是用,命令后加上root
chsh -s /bin/zsh
-
如果遇到重启客户端,没有切换到zsh,还是bash的情况下,则:
sudo vim ~/.bashrc
‘再文件最后后加上zsh
2.2 安装oh-my-zsh
-
curl安装
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
-
wget安装
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh
-
或者从百度云中下载的文件中,先解压成文件夹,在执行以下命令(注意解压后的文件路径,可能跟我的不一样):
cd ~/oh-my-zsh/tools ./install.sh
2.3 安装插件
-
自动提示插件
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
-
命令高亮插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
-
安装完后,使用以下命令修改~/.zshrc文件,吧插件名字添加进去
sudo vim .zshrc plugins = (git zsh-autosuggestions zsh-syntax-highlighting)
2.4 安装主题
-
执行以下命令修改~/.zshrc文件
sudo vim ~/.zshrc
ZSH_THEME="agnoster"
-
会出现字符乱码情况,使用以下命令:
git clone https://github.com/abertsch/Menlo-for-Powerline.git cd Menlo-for-Powerline sudo mv "Menlo for Powerline.ttf" /usr/share/fonts/ sudo fc-cache -vf /usr/share/fonts/
-
命令执行完毕后,需要打开终端->编辑->首选项->找到字体,选择好meslo字体
-
然后再修改~/.oh-my-zsh/themes/agnoste.zsh-theme文件
sudo vim ~/.oh-my-zsh/themes/agnoste.zsh-theme #agnoster 主题设置:隐藏当前用户 prompt_context() { DEFAULT_USER="usrname" } # 建议将原来的prompt_context中等用#注释掉,不要删除