歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> CentOS 7 隱藏任務欄和頂欄

CentOS 7 隱藏任務欄和頂欄

日期:2017/2/28 13:52:24   编辑:Linux教程

我使用的是Gnome,對於使用慣了Windows的我來說,這個界面確實有點丑,但是,也將就著用了,最近發現有一款軟件(Cairo-Dock)可以美化桌面,於是就安裝了,但是安裝之後發現了一個問題:原來的任務欄擋住了這個軟件的界面,於是就想辦法把CentOS 7隱藏任務欄。

1.隱藏任務欄

刪除/usr/share/gnome-shell/extensions/[email protected] 目錄

刪除之前先備份,需要管理員權限,我直接備份到了所在目錄,下邊的操作是在/usr/share/gnome-shell/extensions/進行的

cp [email protected] [email protected]

刪除

rm -rf [email protected]

這兩步也可以直接一步解決

mv [email protected] cp [email protected]

2.隱藏頂欄

需要修改三個文件,分別是/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 gradients
      background-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": ["[email protected]","[email protected]","[email protected]","[email protected]","[email protected]"],
    "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 gradients
    background-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

Copyright © Linux教程網 All Rights Reserved