官方解决方案

官方解决方案

我读到 Xubuntu 18.04 有一个黑暗主题,但我无法在任何地方找到它。我已经从16.04手动升级到最新版本。也许这就是我找不到它的原因,或者我需要额外的工具吗?

答案1

官方解决方案

创建一个~/.config/gtk-3.0/settings.ini包含以下内容的文件。

[Settings]
gtk-application-prefer-dark-theme=true

注销以使这些设置生效。

gtk-application-prefer-dark-theme其他设置是记录在这里

更好的解决方案

官方的 XFCE 解决方案远非完美。远离它,而是将以下两个文件添加到您的系统中。

这将导致Applications Menu所有其他 GTK2/3 应用程序中出现深色 XFCE 以及深色菜单窗格,与标准 Xubuntu LTS 面板颜色一致。

其他 GTK2/3 用户界面表面保持灰鸟灰色。显然,十六进制RGB颜色定义可以随意改变。

1).gtkrc-2.0向您的导演添加一个隐藏文件$HOME,其内容如下:

style "gtk-theme-config-menu" {
    base[NORMAL] = "#2e3436"
    bg[NORMAL] = "#2e3436"
    bg[ACTIVE] = "#2e3436"
    bg[INSENSITIVE] = "#2e3436"
    text[NORMAL] = "#d3d7cf"
    fg[NORMAL] = "#d3d7cf"
}

widget_class"*<GtkMenu>*"style"gtk-theme-config-menu"

2)将一个名为以下内​​容的文件添加gtk.css到目录中。~/.config/gtk-3.0/配置panel已被注释掉,但保留在这里以供参考。

/* Custom styles */

/* select-on */
@define-color selected_bg_color #398ee7;
@define-color selected_fg_color #fff;
@define-color theme_selected_bg_color @selected_bg_color;
@define-color theme_selected_fg_color @selected_fg_color;
/* select-on */

/* panel-off
@define-color panel_bg_color #2e3436;
@define-color panel_fg_color #ffffff;

PanelWidget,
PanelApplet,
PanelToplevel,
PanelSeparator,
PanelApplet > GtkMenuBar.menubar,
PanelApplet > GtkMenuBar.menubar.menuitem,
PanelApplet > menubar,
PanelApplet > menubar.menuitem,
PanelApplet > menubar menuitem,
PanelMenuBar.menubar,
PanelMenuBar.menubar.menuitem,
PanelMenuBar.menubar menuitem,
PanelAppletFrame,
UnityPanelWidget,
.gnome-panel-menu-bar,
.unity-panel,
.xfce4-panel,
.xfce4-panel.background {
    background-color: @panel_bg_color;
    background-image: -gtk-gradient(linear,left top,left bottom,from(shade(@panel_bg_color,1.2)),to(shade(@panel_bg_color,0.8)));
    color: @panel_fg_color;
}

.unity-panel.menuitem,
.unity-panel .menuitem,
.unity-panel menuitem {
    color: @panel_fg_color;
}

.unity-panel.menubar.menuitem:hover,
.unity-panel.menubar .menuitem *:hover,
.unity-panel.menubar menuitem *:hover {
    border-color: shade(@panel_bg_color, 0.7);
    border-image: none;
    background-color: shade(@panel_bg_color, 0.97);
    background-image: -gtk-gradient(linear,left top,left bottom,from(shade(@panel_bg_color, 0.97)),to(shade(@panel_bg_color, 0.82)));
    color: @panel_fg_color;
}

PanelApplet .button,
PanelApplet button,
.xfce4-panel .button,
.xfce4-panel button {
    border-color: transparent;
    border-image: none;
    background-color: transparent;
    color: @panel_fg_color;
    box-shadow: none;
    text-shadow: none;
    -unico-inner-stroke-width: 0;
}

PanelApplet .button:active,
PanelApplet button:active,
.xfce4-panel .button:active,
.xfce4-panel button:active {
    border-color: shade(@panel_bg_color,0.8);
    border-image: none;
    background-color: shade(shade(@panel_bg_color,1.02),0.9);
    background-image: -gtk-gradient(linear,left top,left bottom,from(shade(shade(@panel_bg_color,1.02),0.9)),to(shade(shade(@panel_bg_color,1.02),0.95)));
    color: @panel_fg_color;
    box-shadow: none;
    text-shadow: none;
    -unico-inner-stroke-width: 0;
}

PanelApplet .button:prelight,
PanelApplet button:prelight,
.xfce4-panel .button:hover,
.xfce4-panel button:hover {
    border-color: transparent;
    border-image: none;
    background-color: shade(@panel_bg_color,1.2);
    background-image: -gtk-gradient(linear,left top,left bottom,from(shade(@panel_bg_color,1.2)),to(shade(@panel_bg_color,1.0)));
    color: @panel_fg_color;
    box-shadow: none;
    text-shadow: none;
    -unico-inner-stroke-width: 0;
}

PanelApplet .button:active:prelight,
PanelApplet button:active:prelight,
.xfce4-panel .button:active:hover,
.xfce4-panel button:active:hover {
    border-color: shade(@panel_bg_color,0.8);
    border-image: none;
    background-color: shade(shade(@panel_bg_color,1.02),1.0);
    background-image: -gtk-gradient(linear,left top,left bottom,from(shade(shade(@panel_bg_color,1.02),1.0)),to(shade(shade(@panel_bg_color,1.02),1.05)));
    color: @panel_fg_color;
    box-shadow: none;
    text-shadow: none;
    -unico-inner-stroke-width: 0;
}

WnckPager,
WnckTasklist {
    background-color: @panel_bg_color;
}

panel-off */

/* menu-on */
@define-color menu_bg_color #2e3436;
@define-color menu_fg_color #d3d7cf;

GtkTreeMenu.menu,
GtkMenuToolButton.menu,
GtkComboBox .menu,
GtkComboBox menu {
    background-color: @menu_bg_color;
    background-image: none;
}

.primary-toolbar .button .menu,
.primary-toolbar button menu,
.toolbar .menu,
toolbar menu,
.toolbar .primary-toolbar .menu,
toolbar .primary-toolbar menu,
.menu,
menu,
#toolbar-popup {
    border-style: none;
    background-image: none;
    background-color: @menu_bg_color;
    background-image: none;
    color: @menu_fg_color;
    box-shadow: none;
    text-shadow: none;
    -unico-inner-stroke-width: 0;
}

.menu.button:hover,
menu.button:hover,
.menu.button:active,
menu.button:active,
.menu.button:active:insensitive,
menu.button:active:insensitive,
.menu.button:insensitive,
menu.button:insensitive,
.menu.button,
menu.button {
    background-color: @menu_bg_color;
    background-image: none;
}

GtkTreeMenu .menuitem *,
GtkTreeMenu menuitem * {
    color: @menu_fg_color;
}

.menuitem,
menuitem,
.menu .menuitem,
menu menuitem {
    background-color: transparent;
    background-image: none;
}

.menu .menuitem:active,
menu menuitem:active,
.menu .menuitem:hover,
menu menuitem:hover {
    background-color: @theme_selected_bg_color;
    background-image: none;
}

.menuitem.check,
menuitem.check,
.menuitem.radio,
menuitem.radio,
.menuitem.check:hover,
menuitem.check:hover,
.menuitem.radio:hover,
menuitem.radio:hover,
.menuitem.check:active,
menuitem.check:active,
.menuitem.radio:active,
menuitem.radio:active {
    background-color: transparent;
    background-image: none;
}

.menu .menuitem:insensitive,
menu menuitem:insensitive,
.menu .menuitem *:insensitive,
menu menuitem *:insensitive {
    color: mix(@menu_fg_color,@menu_bg_color,0.5);
}

.menuitem.arrow,
menuitem.arrow {
    color: alpha(@menu_fg_color, 0.6);
}

.menuitem .entry,
menuitem entry {
    border-color: shade(@menu_bg_color,0.7);
    border-image: none;
    background-color: @menu_bg_color;
    background-image: none;
    color: @menu_fg_color;
}

.menuitem .accelerator,
menuitem accelerator {
    color: alpha(@menu_fg_color,0.6);
}

.menuitem .accelerator:insensitive,
menuitem accelerator:insensitive {
    color: alpha(mix(@menu_fg_color,@menu_bg_color,0.5),0.6);
    text-shadow: none;
}

.menuitem.separator,
menuitem.separator {
    background-color: transparent;
    background-image: none;
    color: shade(@menu_bg_color, 0.9);
}

.menuitem GtkCalendar,
menuitem calendar,
.menuitem GtkCalendar.button,
menuitem calendar.button,
.menuitem GtkCalendar.header,
menuitem calendar.header,
.menuitem GtkCalendar.view,
menuitem calendar.view {
    border-color: shade(@menu_bg_color,0.8);
    border-image: none;
    background-color: @menu_bg_color;
    background-image: none;
    color: @menu_fg_color;
}

.menuitem GtkCalendar:inconsistent,
menuitem calendar:inconsistent {
    color: mix(@menu_fg_color,@menu_bg_color,0.5);
}

/* menu-on */

/* End custom styles */

3)退出以使这些更改生效。

相关内容