2019-07-02更新:css
Ubuntu 19.04 作成視頻了 https://www.bilibili.com/video/av55661941前端
2018-11-27更新:linux
關於幾個目錄,GTK、Shell的目錄是:/usr/share/themes,圖標的目錄是/usr/share/icons。
放到/usr/share/下是全局修改,也就是說若是你換一個帳戶登錄,也是能夠用這些主題文件的。弊端就是操做較複雜,須要sudo權限。
若是僅僅是想修改當前帳戶的主題,能夠選擇在/home/YourAccount/(好比 /home/feipeng8848/)下新建兩個目錄:.themes 和 .icons。注意,目錄名稱前面有個點 「 . 」 ,而後把shell、GTK主題文件放到 .themes中,圖標文件放到 .icons 中。shell
安裝完的效果:ubuntu
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
參考:vim
https://linuxhint.com/gnome-tweak-tool-ubuntu-17-10/微信
————————————————————————————————————————————————————ide
下面正式開始
————————————————————————————————————————————————————工具
要安裝主題,首先要先安裝相應的工具:TweakTool字體
sudo apt-get update
sudo apt-get install gnome-tweak-tool
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
下圖就是安裝完後,打開的Tweaks
![](http://static.javashuo.com/static/loading.gif)
修改窗口的按鈕位置
![](http://static.javashuo.com/static/loading.gif)
Before:
![](http://static.javashuo.com/static/loading.gif)
After:
![](http://static.javashuo.com/static/loading.gif)
如今按鈕位置就修改到左邊了
![](http://static.javashuo.com/static/loading.gif)
顯示或隱藏桌面上的圖標
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
修改鼠標圖標
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
去掉Shell上沒法修改的歎號
![](http://static.javashuo.com/static/loading.gif)
執行下面的命令
sudo apt-get install gnome-shell-extensions
![](http://static.javashuo.com/static/loading.gif)
安裝完成後打開Tweaks選擇 「Extensions」選項
![](http://static.javashuo.com/static/loading.gif)
「User themes」 按鈕設置成on
![](http://static.javashuo.com/static/loading.gif)
去「Appearances」選項,就能發現Shell那裏沒有歎號了
![](http://static.javashuo.com/static/loading.gif)
————————————————————————————————————————————————————
到如今咱們已經把工具安裝配置完成了,下面正式安裝主題
————————————————————————————————————————————————————
1.安裝GTK主題
去這個連接:https://www.opendesktop.org/s/Gnome/p/1171688/
上面的連接掛了,可以使用其餘相關連接:
1.https://www.opendesktop.org/s/Gnome/p/1013714/
2.https://www.opendesktop.org/s/Gnome/p/1241688
![](http://static.javashuo.com/static/loading.gif)
網頁上有好幾個標籤:Prodect、FIles、Changelogs等等
找到Files標籤,去下載文件。點擊文件名就能夠下載。
![](http://static.javashuo.com/static/loading.gif)
能夠看到這裏一共有6個壓縮文件,分別包裝各類主題。經過文件名能發現每個文件都有一個「2」,這個2的意思是該壓縮包下有兩個主題。
隨便選中一個好比Gnome-OSC-HS--2themes.tar.xz(第一個文件),下載下來。
經過xz和tar命令解壓
xz -d Gnome-OSC-HS--2-themes.tar.xz
tar xvf Gnome-OSC-HS--2-themes.tar
解壓後獲得的文件夾中有兩個文件夾
![](http://static.javashuo.com/static/loading.gif)
這兩個文件夾分別是兩個主題,把這兩個文件夾移動到/usr/share/themes下就能夠了。
而後打開前面安裝的工具Tweaks(中文下叫「優化」),在「應用程序」英文是「Applications」這個選項下就能夠選擇剛剛安裝的主題了。這幾個截圖是我安裝主題後的截圖。
![](http://static.javashuo.com/static/loading.gif)
剛剛是兩個文件夾,就是兩個主題,這兩個主題從名字上看只有transparent前面是否有個not,顧名思義就是有沒有透明效果。
到如今已經修改了外觀樣式,最大化最小化的樣式已經很蘋果了。
2.修改圖標
去下面的連接下載
https://www.opendesktop.org/s/Gnome/p/1102582/
![](http://static.javashuo.com/static/loading.gif)
解壓後把文件都放到/usr/share/icons目錄下,以下圖(這是已經應用過主題的截圖)所示:
![](http://static.javashuo.com/static/loading.gif)
而後去Tweaks中應用一下
![](http://static.javashuo.com/static/loading.gif)
3.修改桌面Shell
去這個連接:https://www.opendesktop.org/s/Gnome/p/1013741/
下載下面紅框裏的
![](http://static.javashuo.com/static/loading.gif)
應用下(/usr/share/themes)
![](http://static.javashuo.com/static/loading.gif)
效果:
![](http://static.javashuo.com/static/loading.gif)
--------------------
2018-09-09更新
關於grub2,開機選擇部分。
--------------------
找到/boot/grub/grub.cfg文件,找到這樣一行: if background_color 44,0,30,0;修改爲 if background_color 0,0,0,0;就會去除grub在選中Ubuntu系統以後出現的短暫的紫色。
對於grub的主題,我選的是Grub-theme-vimix,以下圖:
![](http://static.javashuo.com/static/loading.gif)
解壓後執行文件夾中的install便可。
--------------------
2018-05-09更新
關於plymouth theme,開機動畫。
--------------------
![](http://static.javashuo.com/static/loading.gif)
如上圖所示,/etc/alternatives/default.plymouth文件指定了一個logo文件夾,指定了一個執行腳本。開機的時候就用這個文件指定的logo和腳本執行。
那麼思路就是,把logo文件夾和腳本指定成別的就能夠修改開機動畫。
開機動畫主題沒找到好看的,試一下這個吧:
![](http://static.javashuo.com/static/loading.gif)
下載下壓縮包,解壓後:
![](http://static.javashuo.com/static/loading.gif)
把解壓的文件mv到 /usr/share/plymouth/themes/目錄下
![](http://static.javashuo.com/static/loading.gif)
而後去修改下/etc/alternatives/default.plymouth(先備份源文件)成以下
![](http://static.javashuo.com/static/loading.gif)
實際圖示就相似下圖,不過中間的logo是會轉動的(手機錄製的很差看就不貼gif了)
![](http://static.javashuo.com/static/loading.gif)
--------------------
2018-05-10更新
GDM(GNOME Display Manager,GDM)主題,也就是登陸界面的主題
--------------------
選了一個主題https://www.opendesktop.org/s/Gnome/p/1207015/,以下
![](http://static.javashuo.com/static/loading.gif)
解壓壓縮包
![](http://static.javashuo.com/static/loading.gif)
該文件夾下有三個文件
![](http://static.javashuo.com/static/loading.gif)
先說明下修改登陸界面樣式的原理:
重要步驟是在css文件,這個/usr/share/gnome-shell/theme/ubuntu.css就配置了登陸界面的樣式。
在/usr/share/gnome-shell/theme/ubuntu.css文件(上面我下載的包中,非系統自帶的這個css文件)中有這樣一行代碼:
![](http://static.javashuo.com/static/loading.gif)
是的,Ubuntu18.04的登陸界面是用css文件渲染的,作網頁前端的應該最熟悉不過了。
若是你只想替換登陸界面的背景,把系統自帶的這個css文件中指定圖像文件的位置修改爲你本身的圖片的絕對目錄就好了。
固然,若是你想讓你的登陸界面炫酷一些,修改css文件,渲染成你想要的效果便可。
或者你想省事,那就和我同樣去網上下載別人寫好的css文件。
在我下載的
中,還有個腳本文件,內容以下:
![](http://static.javashuo.com/static/loading.gif)
有註釋,這個腳本的做用是把你如今正在用的壁紙模糊處理,而後放到 ~/Pictures/gdm_look.jpg,執行過腳本後,你的 ~/Pictures目錄下就會多一個gdm_look.jpg文件,這個文件就是你當前用的壁紙的模糊處理事後的圖片。
而後 ~/Pictures/gdm_look.jpg又被複制到/usr/share/backgrounds/目錄下,再看下面這個圖
![](http://static.javashuo.com/static/loading.gif)
這個包中提供的css文件指定的登陸頁面壁紙,也就是腳本處理完後cp到/usr/share/backgrounds/的gdm_look.jpg。
至此,原理說明白了,操做以下:
備份/usr/share/gnome-shell/theme/ubuntu.css
sudo cp /usr/share/gnome-shell/theme/ubuntu.css /usr/share/gnome-shell/theme/ubuntu.css.backup
用下圖中的ubuntu.css替換掉系統自帶的/usr/share/gnome-shell/theme/ubuntu.css
把SetAsWallpaper腳本文件複製到~/.local/share/nautilus/scripts/目錄下,而後修改下權限(若是須要)
sudo chmod +x SetAsWallpaper
而後重啓nautilus(下面的命令是關閉)
點擊桌面右下角「全部應用」,查找「nautilus 」
![](http://static.javashuo.com/static/loading.gif)
執行以下命令,修改下 /usr/share/backgrounds 的權限.
sudo chmod 777 /usr/share/backgrounds/
最後一步,去~/.local/share/nautilus/scripts/ 目錄下執行下SetAsWallpaper腳本。
重啓系統就行了。(執行腳本後,你的桌面壁紙可能會沒了,從新設置下就行了)
最後放一張效果圖:
![](http://static.javashuo.com/static/loading.gif)
--------------------
2018-05-12更新
TopBar
--------------------
我使用的gnome-shell主題是
它的TopBar是這樣的
字體略粗,且很寬太佔空間。
修改後的樣子
這樣明顯好看一些。
下面正式開始修改,因爲我是用的Sierra-compact-light主題,因此要去這個主題下面的配置文件(實際上是一個css文件)修改,就是下面的目錄
/usr/share/themes/Sierra-compact-light/gnome-shell/gnome-shell.css
若是你是想修改Ubuntu默認的TopBar就不是上面這個目錄了而應該是Ubuntu默認Shell的目錄,多是下面幾個文件中修改,由於我沒試過,因此不肯定具體是哪一個文件。
![](http://static.javashuo.com/static/loading.gif)
回到/usr/share/themes/Sierra-compact-light/gnome-shell/gnome-shell.css文件,也就是個人主題文件,ctrl+f找#panel
修改TopBar高度
![](http://static.javashuo.com/static/loading.gif)
加粗字體改爲正常字體
![](http://static.javashuo.com/static/loading.gif)
保存重啓就行了。
--------------------
2018-05-19更新
Dash to Dock
--------------------
打開Ubuntu Software,直接搜索 dash to dock,安裝上。
![](http://static.javashuo.com/static/loading.gif)
打開Tweaks -> Extensions,注意,這裏不要打開Dash to Dock擴展,修改樣式直接點擊齒輪按鈕就好,我嘗試打開,可是鎖屏後再進入桌面會有bug。
![](http://static.javashuo.com/static/loading.gif)
個人設置以下
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
效果:
![](http://static.javashuo.com/static/loading.gif)
比起docky這個的好處是直接修改的系統的dock,而docky是直接添加了一dock且系統自帶的dock也不能移除,但docky有macOS的放大效果這個沒有。
——————————————————————————————————————————————————————————
上面的一些資源網網站有特別慢的狀況有想要資源包的可評論留下郵箱我發或者加我微信。儘可能能上網站上去下載,由於網站上會有相應的安裝說明,上面我作的大多數也都是搬運翻譯的。有問題能夠留言探討。
![](http://static.javashuo.com/static/loading.gif)
或者用網盤吧
資源連接: https://pan.baidu.com/s/1fLKb2C9hDEqcK3JyX5icFQ 密碼: q4k3