Unity和Gnome Shell中是否可能有不同的GTK +主题?


10

我有时会使用两个不同的桌面环境,例如Unity和Gnome Shell(比较,测试,创建屏幕截图等),但是使用Adwaita主题时Unity看起来很糟糕,这与Gnome Shell和Ambiance主题相同。每次更改都很麻烦,有时(但现在比以前更少了)会崩溃(我正在使用Oneiric)。


这两个会话都使用相同的主题,因为您使用的是用户登录,因此选择一个新用户即可。
乌里·埃雷拉

Answers:


2

您可以尝试创建一个脚本,将其设置为在每次启动时执行,以识别正在使用的DE并在运行的基础上切换主题


是否可以通过脚本更改主题?我可以使用XDG_CURRENT_DESKTOP来了解DE,但是我不知道Gnome 3如何保存主题设置。
Arnel A. Borja

6

基于先前的答案:

对于11.10

#!/bin/bash

if [ "$XDG_CURRENT_DESKTOP" = "Unity" ]
then
  gsettings set org.gnome.desktop.interface gtk-theme 'Ambiance'
  gconftool-2 --set --type string /apps/metacity/general/theme 'Ambiance'
  gsettings set org.gnome.desktop.interface icon-theme 'Faenza-Ambiance'

else
  gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita'
  gconftool-2 --set --type string /apps/metacity/general/theme 'Adwaita'
  gsettings set org.gnome.desktop.interface icon-theme 'Faenza'

fi

对于12.04和12.10

#!/bin/bash

if [ "$XDG_CURRENT_DESKTOP" = "Unity" ]
then
  gsettings set org.gnome.desktop.interface gtk-theme 'Ambiance'
  gsettings set org.gnome.desktop.interface icon-theme 'ubuntu-mono-dark'
  gsettings set org.gnome.desktop.wm.preferences theme 'Ambiance'

else 
  gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita'
  gsettings set org.gnome.desktop.interface icon-theme 'gnome'
  gsettings set org.gnome.desktop.wm.preferences theme 'Adwaita'

fi

将此脚本添加到Startup Applications(Add => Command sh path/to/script)。


0

对于16.10

使用启动应用程序 (由Matteo建议)并改编海德先生启动脚本

#!/bin/bash

if [ "$XDG_CURRENT_DESKTOP" = "Unity" ]
then
  gsettings set org.gnome.desktop.interface gtk-theme 'Ambiance'
  gsettings set org.gnome.desktop.interface icon-theme 'ubuntu-mono-dark'
  gsettings set org.gnome.desktop.interface cursor-theme 'DMZ-White'
  gsettings set org.gnome.desktop.wm.preferences theme 'Ambiance'

else 
  gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita'
  gsettings set org.gnome.desktop.interface icon-theme 'Adwaita'
  gsettings set org.gnome.desktop.interface cursor-theme 'Adwaita'
  gsettings set org.gnome.desktop.wm.preferences theme 'Adwaita'

fi
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.