2

I have read that Xubuntu 18.04 has a dark theme, but I could not find it anywhere. I have manually upgraded to the newest version from 16.04. Perhaps this is the reason why I could not find it, or do I need an extra tool?

  • what command did you used in upgrading to the newest version? – antzshrek May 10 '18 at 5:42
  • I ran sudo do-release-update -d – gamofe May 10 '18 at 5:53
0

Official solution

Create a ~/.config/gtk-3.0/settings.ini file with the following content.

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

Logout for these settings to take effect.

gtk-application-prefer-dark-theme and other settings are documented here.

Better solution

The official solution is far from perfect with XFCE. Stay away from it and rather add the following two files to your system.

This will result in a dark XFCE Applications Menu as well as dark menu panes in all other GTK2/3 applications, in line with the standard Xubuntu LTS panel colours.

Other GTK2/3 user interface surfaces remain Greybird grey. Obviously, the hexadecimal RGB colour definitions can be changed as one likes.

1) Add a hidden .gtkrc-2.0 file to your $HOME director with the following contents:

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) Add a file named gtk.css to the ~/.config/gtk-3.0/ directory with below content. The panel configuration is commented out, but is kept here for reference.

/* 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) Log out for these changes to take effect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.