首页 / 操作系统 / Linux / CentOS 7 隐藏任务栏和顶栏
我使用的是Gnome,对于使用惯了Windows的我来说,这个界面确实有点丑,但是,也将就着用了,最近发现有一款软件(Cairo-Dock)可以美化桌面,于是就安装了,但是安装之后发现了一个问题:原来的任务栏挡住了这个软件的界面,于是就想办法把CentOS 7隐藏任务栏。
1.隐藏任务栏
删除/usr/share/gnome-shell/extensions/window-list@gnome-shell-extensions.gcampax.github.com 目录 删除之前先备份,需要管理员权限,我直接备份到了所在目录,下边的操作是在/usr/share/gnome-shell/extensions/进行的cp window-list@gnome-shell-extensions.gcampax.github.com window-list@gnome-shell-extensions.gcampax.github.com.backup删除rm -rf window-list@gnome-shell-extensions.gcampax.github.com这两步也可以直接一步解决mv window-list@gnome-shell-extensions.gcampax.github.com cp window-list@gnome-shell-extensions.gcampax.github.com.backup2.隐藏顶栏
需要修改三个文件,分别是/usr/share/gnome-shell/modes/classic.json,/usr/share/gnome-shell/theme/gnome-classic.css 和/usr/share/gnome-shell/theme/gnome-shell.css/usr/share/gnome-shell/modes/classic.json还是先备份,进入/usr/share/gnome-shell/modes/目录cp classic.json classic.json.backup修改内容,vi在命令模式下可以使用“/关键词“进行查找vi classic.json修改如下 "panel":{ "left": [],"center": [], "right": [] }/usr/share/gnome-shell/theme/gnome-classic.css再说一遍,先备份修改如下#panel {background-color: #e9e9e9;background-gradient-direction: vertical;background-gradient-end: #d0d0d0;border-top-color: #666; /* we don"t supportnon-uniform border-colors and use the top bordercolor for any border, so we need to set iteven if all we want is a bottom border */border-bottom: 1px solid #666;app-icon-bottom-clip: 0px; color: transparent; /* hrm, still no multipoint gradientsbackground-image: linear-gradient(left,rgba(255, 255, 255, 0),rgba(255, 255, 255, 1) 50%,rgba(255, 255, 255, 0)) !important;*/ }/usr/share/gnome-shell/theme/gnome-shell.css修改两处最后一次强调,先备份//第一处
#panel {background-color:transparent;font-weight: bold;height: 0px; }
//第二处 .panel-logo-icon {padding-right: .4em;icon-size: 1px;} 原始代码/usr/share/gnome-shell/modes/classic.json {"parentMode": "user","stylesheetName": "gnome-classic.css","enabledExtensions": ["apps-menu@gnome-shell-extensions.gcampax.github.com","places-menu@gnome-shell-extensions.gcampax.github.com","alternate-tab@gnome-shell-extensions.gcampax.github.com","launch-new-instance@gnome-shell-extensions.gcampax.github.com","window-list@gnome-shell-extensions.gcampax.github.com"],"panel": { "left": ["activities", "appMenu"], "center": [], "right": ["a11y", "keyboard", "dateMenu", "aggregateMenu"] }} /usr/share/gnome-shell/theme/gnome-classic.css #panel {background-color: #e9e9e9;background-gradient-direction: vertical;background-gradient-end: #d0d0d0;border-top-color: #666; /* we don"t support non-uniform border-colors and use the top border color for any border, so we need to set it even if all we want is a bottom border */border-bottom: 1px solid #666;app-icon-bottom-clip: 0px;/* hrm, still no multipoint gradientsbackground-image: linear-gradient(left, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0)) !important;*/}/usr/share/gnome-shell/theme/gnome-shell.css//这是我后来改的,原先的忘记备份了,可以正常显示,和原来差不多
#panel {background-color: #fff;font-weight: bold;height: 1.8em;} .panel-logo-icon {padding-right: .4em;icon-size: .4em;}更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14本文永久更新链接地址