GTK+

GTK+, or the GIMP Toolkit, is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, GTK+ is suitable for projects ranging from small one-off tools to complete application suites.

GTK+, The GIMP Toolkit, was initially made by the GNU Project for GIMP, but it is now a very popular toolkit with bindings for many languages. This article will explore the tools used to configure the GTK+ theme, style, icon, font and font size, and also detail manual configuration.

Themes

In GTK+ 2, the default theme is Raleigh, but Arch Linux has a custom configuration file at /usr/share/gtk-2.0/gtkrc, which sets the default theme to Adwaita. In GTK+ 3, the default theme is Adwaita, but HighContrast, HighContrastInverse and Raleigh themes are also included.

Note: Because GTK+ 3 changes rapidly, GTK+ 3 themes often require re-working after a GTK+ 3 release. For this reason, not all GTK+ 3 themes may look as intended when used with the latest GTK+ 3 version.

GTK+ and Qt

If you have GTK+ and Qt (KDE) applications on your desktop then you know that their looks do not blend well. If you wish to make your GTK+ styles match your Qt styles please read Uniform look for Qt and GTK applications.

Legacy scrolling behavior

Note: This setting is not obeyed by all GTK+ applications.

Tip: Legacy scrolling behaviour can be achieved reliably simply by using right click instead of left click.

Prior to GTK+ 3.6, clicking on either side of the slider in the scrollbar would move the scrollbar in the direction of the click by approximately one page. Since GTK+ 3.6, the slider will move directly to the position of the click. This behaviour can be reverted in some applications by creating the file with the content below:

~/.config/gtk-3.0/settings.ini

[Settings]
gtk-primary-button-warps-slider = false

Disable overlay scrollbars

Since GTK+ 3.15, overlay scrollbars are enabled by default, meaning that scrollbars will be shown only on mouseover in GTK+ 3 applications. This behavior can be reverted by setting the following environment variable: GTK_OVERLAY_SCROLLING=0. See Environment variables#Graphical applications[broken link: invalid section].

GTK+ 4 will no longer support GTK_OVERLAY_SCROLLING. It has already been dropped from master. As of GTK+ 4, the overlay nature of the scrollbars is part of the toolkit. The blanket toggle has been removed to prevent developers from breaking applications that haven't been tested with both combinations. To allow application developers to decide what their applications should look like, the toolkit instead provides a mechanism to opt-out or add a setting for users. The function gtk_scrolled_window_set_overlay_scrolling() can be used to enable/disable overlay scrolling on a per-application basis. Application developers can optionally use GSettings to have a user setting bound to the property.

Remove overlay scroll indicators

The positions of the overlay scrollbars are indicated by thin dashed lines in the application window. These dashed lines will be present even when overlay scrolling is disabled using the environment variable discussed in the section above. To remove the indicator lines, create the following file:

Wayland backend

The GDK Wayland backend can be enabled by setting the GDK_BACKEND=wayland environment variable.

Tip: To disable GTK window decorations in Wayland, install the gtk3-optional-csdAUR package and set the environment variable GTK_CSD=0.

Troubleshooting

Different themes between GTK+ 2 and GTK+ 3 applications

In general, if a selected theme has support for both GTK+ 2 and GTK+ 3, the theme will be applied to all GTK+ 2 and GTK+ 3 applications. If a selected theme has support for only GTK+ 2, it will be used for GTK+ 2 applications and the default GTK+ theme will be used for GTK+ 3 applications. If the selected theme has support for only GTK+ 3, it will be used for GTK+ 3 applications and the default GTK+ theme will be used for GTK+ 2 applications. Thus for application theme consistency, it is best to use a theme which has support for both GTK+ 2 and GTK+ 3.

You could find what themes installed on your system have both an GTK+ 2 and GTK+ 3 version by using this command (does not work with names containing spaces):

Suppress warning about accessibility bus

To suppress these warnings, execute programs with NO_AT_BRIDGE=1 or set that as a global environment variable.

Titlebar background color mismatch

If you are using a window manager which uses a window decoration theme that mimics the GTK+ theme background color, you may find that the titlebar color no longer completely matches the application color in some GTK+ 3 applications. As a workaround, create the following file:

Thumbnail support for GTK+ 2 file dialog

Button and menu icons

The factual accuracy of this article or section is disputed.

Reason: Explain what the issue is. GNOME ignores settings.ini if GDM is used. (Discuss in Talk:GTK+#)

For some applications in GNOME's Wayland session. Your ~/.config/gtk-3.0/settings.ini file is misconfigured. This can happen if you try other GTK+ based desktop environments. These are the offending values:

~/.config/gtk-3.0/settings.ini

[Settings]
gtk-button-images=1
gtk-menu-images=1

Simply set them to 0 or remove the whole file to use GNOME defaults.

GTK+ 3 without polkit

GTK+3 depends on polkit through colord, which is required for printing. However printing works fine without polkit installed; at least with a monochrome printer and package versions gtk3-print-backends=3.22.19-2 and colord=1.4.1-1.

Some GTK+ 2 themes only change the UI color palette

Depending on the theme of choice's support for GTK+ 2, UI controls may still have the default Raleigh appearance, possibly with a different color palette. This is due to these themes requiring the GTK+ 2 Murrine engine, which is missing (GTK+ 2 programs should complain about it on their standard error output). Install the gtk-engine-murrine package.