- Dark mode switching
- Contents
- Tools
- Toolkits
- xsettings daemon
- gsettings
- Applications
- Firefox
- Thunderbird
- Visual Studio Code
- Alacritty
- GTK (Русский)
- Contents
- Установка
- GTK+ и Qt
- Средства настройки
- Настройка
- Базовая настройка темы
- Вариант тёмной темы
- Горячие клавиши
- Задержка меню GNOME
- Уменьшить размер виджетов
- Место запуска выбора файла
- Наследие поведения скроллбара
- Отключить наложение скролбара
- Удалить наложенные показателя скролбара
- GTK+ и HTML с Broadway
- Решение проблем
- Различные темы приложений между GTK+ 2 и GTK+ 3
- Тема не применяется к root-приложениям
- Клиентские декорации
- Седиль ç/Ç вместо ć/Ć (характерно в основном для Французского языка)
- Подавить предупреждение о accessibility bus
- Не соответствует цвет фона в строке заголовка (TitleBar)
- Неправильный фокус событий в тайловых оконных менеджерах
- Поддержка эскизов для диалога файлов GTK + 2
- Примеры
- Arch linux dark theme
- Contents
- Installation
- Themes
- GTK and Qt
- Configuration tools
- Configuration
- Basic theme configuration
- Dark theme variant
- Keyboard shortcuts
- Emacs key bindings
- GNOME menu delay
- Reduce widget sizes
- Hide CSD buttons
- Disable mouse paste
- File-chooser start-up location
- Legacy scrolling behavior
- Disable overlay scrollbars
- Remove overlay scroll indicators
- Examples
- GDK backends
- Wayland backend
- Xorg backend
- Broadway backend
- Troubleshooting
- Different themes between GTK 2 and GTK 3 applications
- Theme not applied to root applications
- Client-side decorations
- cedilla ç/Ç instead of ć/Ć
- Suppress warning about accessibility bus
- Titlebar background color mismatch
- Wrong focus events with tiling window managers
- Thumbnail support for GTK file dialog
- Button and menu icons
- GTK 3 without polkit
- Some GTK 2 themes only change the UI color palette
- Patching GTK file chooser to use regular type ahead
- Text in GTK 4 applications is blurry or renders incorrectly
Dark mode switching
Switching between light and dark modes/themes is nice to have. It allows you to switch to dark mode on sunset or toggle modes with a keyboard shortcut.
The switch between themes can apply to currently running programs, probably requiring a daemon, or only to newly launched ones. This article focuses on switching at runtime, so toggling during use affects currently running programs.
Switching between light and dark mode requires support from applications or application toolkits like GTK and Qt.
Contents
Tools
- darkman — darkman is a tool that allows automating transitioning to dark mode at sundown, and back to light mode at sunrise. It allows placing drop-in scripts to be run automatically at those times.
https://gitlab.com/WhyNotHugo/darkman/ || darkmanAUR
- Yin-Yang — Yin-Yang is another tool with a similar feature set, running custom scripts is, however, not supported yet.
https://github.com/oskarsh/Yin-Yang || yin-yang-gitAUR
Toolkits
To change the light/dark mode, you have to change the used theme.
Most themes do have a dark variant and those have by convention the suffix -dark . For example the default GTK theme Adwaita has the variant Adwaita-dark .
To permanently change to the dark variant, see GTK#Dark theme variant
To switch themes instantly for running programs, either a daemon providing the xsettings spec or gsettings is required. For desktops running with Xorg, an xsettings daemon is needed. For desktops running with Wayland, gsettings is queried.
xsettings daemon
xsettings is queried for Xorg sessions
The xsettings daemon from Xfce is xfsettingsd, which is provided by the xfce4-settings package.
To query current GTK theme:
To set GTK theme:
Changes to this entry are instant and affect all GTK applications.
gsettings
gsettings is queried for Wayland sessions.
To query the current GTK theme:
To set GTK theme:
Changes to this entry are instant and affect all GTK applications.
Qt has theme support similar to GTK.
One method to theme Qt applications is using GTK for styling. Changes to the GTK theme then affect Qt applications as well.
Another method is using a native Qt theme, e.g. adwaita-qt AUR . To switch between themes, you can follow Qt#Configuration of Qt5 apps under environments other than KDE Plasma.
Applications
Firefox
Firefox automatically uses the current GTK theme mode and adapts the appearance of the browser accordingly. See Firefox#Dark themes for some more settings and caveats.
To change web content smartly, the Dark Reader Add-On is recommended.
By setting Automation to Use system color scheme , Dark Reader activates automatically with dark GTK themes.
Thunderbird
Thunderbird conforms with the current GTK Theme, but some changes are recommended.
Visual Studio Code
To change the theme in Visual Studio Code, this script may help.
Alacritty
Alacritty has support for multiple custom color schemes. The configuration syntax and published color schemes can be found here.
To quickly change theme, you should declare a pointer to each color scheme, for example &black . Then you can switch to a color scheme by simply setting colors: *black . This change to the configuration file is instant and affects all currently running instances. If not, you may have to set live_config_reload: true .
The borders and title bar are themed with GTK. To abide by the GTK theme, you should set the setting gtk_theme_variant to the default None .
Источник
GTK (Русский)
Перевод этой статьи или раздела не отражает оригинальное содержание.
GTK+, или GIMP Toolkit — это мультиплатформенный инструментарий для разработки графического пользовательского интерфейса. Offering a complete set of widgets, GTK+ is suitable for projects ranging from small one-off tools to complete application suites.
GTK+, GIMP Toolkit, изначально сделан проектом GNU для GIMP, но теперь это очень популярный инструмент связанный с многими языками. Эта статья будет исследовать инструменты, используемые для настройки GTK+ тем, стилей, иконок, шрифтов и размеров шрифтов, а также подробную ручную настройку.
Contents
Установка
Две версии GTK+ в настоящее время доступны в официальных репозиториях. Они могут быть установлены со следующими пакетами:
- GTK+ 3.x доступен с пакетом gtk3 .
- GTK+ 2.x доступен с пакетом gtk2 .
- GTK+ 1.x доступен с пакетом gtkAUR .
В GTK+ 2, тема по умолчанию Raleigh, но Arch Linux имеет пользовательский файл настроек /usr/share/gtk-2.0/gtkrc , который устанавливает тему по умолчанию Adwaita. В GTK+ 3, тема по умолчанию Adwaita, но также включены темыHighContrast и Raleigh.
Чтобы установить определенную тему, вы можете задать переменные среды.
- Для GTK+ 2, используйте переменную среду GTK2_RC_FILES например:
запустит GIMP с Industrial theme.
- Для GTK+ 3, используйте переменную среду GTK_THEME например:
Будет запущен GNOME Калькулятор с тёмным вариантом темы Adwaita.
Другие темы могут быть установлены из официальных репозиториев или из AUR.
С поддержкой обеих GTK+ 2 и GTK+ 3:
Поддерживается только GTK+ 2:
светлый текст на светлом фоне), так что вам нужно использовать предоставленный фон панели.
GTK+ и Qt
Если у вас есть GTK+ и Qt (KDE) приложения на рабочем столе, то вы знаете, что их внешность не сочетается/не совпадает.Если вы хотите, чтобы ваши стили GTK+ соответствовали вашим стилям Qt прочитайте Единый внешний вид приложений Qt и GTK.
Средства настройки
Большинство крупных окружений рабочего стола предоставляют инструменты для настройки тем GTK+, иконок, шрифта и размера шрифта, и управляют этими настройками с помощью XSettings:
- Если вы используете Cinnamon, используйте Themes tool (cinnamon-settings themes): перейдите в Параметры > Параметры системы > Оформление.
- Если вы используете Enlightenment: перейдите в Settings > All > Look > Application Theme.
- Если вы используете GNOME, используйте Gnome Tweaks (gnome-tweaks): установите gnome-tweaks .
- Если вы используете MATE, используйте Appearance Preferences tool (mate-appearance-properties): перейдите в Система > Параметры > Внешний вид.
- Если вы используете Xfce, используйте Appearance tool: перейдите Настройки > Внешний вид.
- Если вы используете Openbox, перейдите в obconf > Тема или lxappearance с установленным lxappearance-obconf, тогда lxappearance-obconf > Рамка окна > Тема.
Другие графические инструменты, как правило перезаписывают файлы настроек.
Поддерживаются оба GTK+ 2 и GTK+ 3:
- KDE GTK Configurator — Приложение, которое позволяет изменять стиль и шрифт GTK+2 и Gtk+3 приложений.
https://projects.kde.org/kde-gtk-config || kde-gtk-config После установки, kde-gtk-config также можно найти в System Settings > Application Appearance > GTK.
- LXAppearance — независимая от Окружения рабочего стола утилита настройки GTK+2 и GTK+3, от проекта LXDE (не требует других частей LXDE).
https://wiki.lxde.org/en/LXAppearance || lxappearance
Поддерживается только GTK+ 2:
Настройка
Параметры GTK+ могут быть вручную заданы в файлах настройки, но окружение рабочего стола и приложения могут переопределить эти параметры. В зависимости от версии GTK+, эти файлы находятся по пути:
- GTK+ 2 конкрентного пользователя:
/.config/gtkrc-2.0
Базовая настройка темы
Для ручного изменения темы GTK+, иконок, шрифтов и размера шрифтов, добавьте следующие файлы настроек, например:
Вариант тёмной темы
Некоторые темы GTK+ 3 содержат тёмный вариант темы, но он используется только когда приложение запрашивает именно его. Чтобы использовать вариант темной темы со всеми GTK+ 3 приложениями, установите:
Горячие клавиши
Keyboard shortcuts (otherwise known as accelerators in GTK+) may be changed by hovering the mouse over the respective menu item, and pressing the desired key combination. To enable this feature, set:
Задержка меню GNOME
Этот параметр управляет задержкой между «указыванием мыши» на меню и «открытием меню». Эта задержка измеряется в миллисекундах.
Уменьшить размер виджетов
Если у вас небольшой экран, или вы просто не любите большие иконки и виджеты, вы можете изменить их размер.
Для того чтобы иконки были без текста в панели инструментов ((допустимые значения)), используйте
Чтобы использовать меньшие иконки:
Или, чтобы удалить иконки из кнопок полностью:
Вы также можете удалить из меню иконки:
Место запуска выбора файла
Чтобы открывать диалог «выбор файла» (например при открытии/сохранении) в текущем рабочем каталоге а не в последнем (recent) месте (обычно текущий-рабочий-каталог это домашний каталог), сделайте следующее:
Измените DConf с gsettings:
Измените файл настроек
Наследие поведения скроллбара
До GTK+ 3.6, щелчёк в обе стороны от ползунка сдвинет прокрутку в направлении щелчка, примерно на одну страницу. Так GTK+ 3.6, слайдер сразу перейдёт к позиции мыши. Такое поведение можно отменить в некоторых приложениях путем создания файла с содержимым, приведенным ниже:
Отключить наложение скролбара
С GTK+ 3.15, наложения полосы прокрутки по умолчанию включено, что означает, что полосы прокрутки будут показываться только при наведении курсора мыши на GTK+ 3 приложение. Такое поведение можно отменить, установив следующую переменную окружения: GTK_OVERLAY_SCROLLING=0 .
Удалить наложенные показателя скролбара
Позиции наложения прокрутки обозначены тонкими пунктирными линиями в окне приложения. Эти пунктирные линии будут присутствовать, даже если накладка прокрутка отключена с помощью переменной сред, которая обсуждались в предыдущем разделе. Для удаления индикаторных линий, создайте следующий файл:
GTK+ и HTML с Broadway
GDK Broadway обеспечивает поддержку для отображения GTK+ приложений в веб-браузере, используя HTML5 и веб-соккеты. [3]
При использовании broadwayd, укажите номер дисплея для использования с префиксом двоеточие, похожий на X. На дисплее по умолчанию номер 1.
Порт используемый по умолчанию
В качестве альтернативы, можно установить адрес и порт
Решение проблем
Различные темы приложений между GTK+ 2 и GTK+ 3
В общем, если выбранная тема имеет поддержку как для GTK+ 2 и GTK+ 3, тема будет применяться для всех GTK+ 2 и GTK+ 3 приложений. Если выбранная тема имеет поддержку только GTK+ 2, будет использоваться для GTK+ 2 приложений, и GTK+ тема по умолчанию будет использоваться для GTK+ 3 приложений. Если выбранная тема имеет поддержку только GTK+ 3, то будет использована для GTK+ 3 приложений, и GTK+ тема по умолчанию будет использоваться для GTK+ 2 приложений. Таким образом, для согласования тем приложений, лучше использовать тему, которая имеет поддержку как GTK+ 2 так и GTK+ 3.
Вы можете найти установленные темы на вашей системе с поддержкой обоих версий GTK+ 2 и GTK+ 3, используя эту команду (не работает с именами, содержащими пробелы):
Тема не применяется к root-приложениям
Пользовательский файл темы ( $XDG_CONFIG_HOME/gtk-3.0/settings.ini ,
/.gtkrc-2.0 ) не может быть прочитан другими аккаунтами, выбранная тема не будет применяться к приложениям X запущенных от root. Возможное решение включает в себя:
- Настройку файла темы для всей системы: /etc/gtk-3.0/settings.ini (GTK+ 3) или /etc/gtk-2.0/gtkrc (GTK+ 2)
- Создание символьной ссылки, т.е.
- Смена темы от root
- Используйте настройки демона (это в большинстве окружений рабочего стола). Вариант desktop-agnostic использует XSettings доступный в AURxsettingsd-gitAUR .
Клиентские декорации
С версии GTK 3.12 введены Клиентские декорации, которые действуют в титлбаре от оконного менеджера. Это может решить такие вопросы как двойной титл-бар, нет титл-бара вообще, или двойная тень с включенным композитингом.
Чтобы удалить тень и зазор вокруг окон (например, в сочетании с тайловым оконным менеджером), создайте следующий файл:
Чтобы настроить кнопки на панели заголовка, используйте опцию gtk-decoration-layout . [4] Приведенный ниже пример удаляет все кнопки:
Седиль ç/Ç вместо ć/Ć (характерно в основном для Французского языка)
Смотрите [5], и [6] [устаревшая ссылка 2020-08-02] для решения проблемы с использованием Xcompose (US international layout).
Подавить предупреждение о accessibility bus
Если вы не используете функции Gnome Accessibility (специальных возможностей),вы можете получать такие предупреждения :
вы можете подавить предупреждение, запуская программу с NO_AT_BRIDGE=1 или установить в качестве глобальной переменной окружения
Не соответствует цвет фона в строке заголовка (TitleBar)
Если вы используете оконный менеджер который использует тему декорации окон, которая имитирует цвет темой фона GTK+, вы можете обнаружить, что цвет заголовка окна больше не совпадает полностью с цветом приложений в некоторых приложениях GTK+ 3. В качестве обходного пути, создайте следующий файл:
Неправильный фокус событий в тайловых оконных менеджерах
Определите GDK_CORE_DEVICE_EVENTS=1 для использования стиля ввода GTK2, вместо xinput2. [8]
Поддержка эскизов для диалога файлов GTK + 2
Установите gtk2-patched-filechooser-icon-view AUR чтобы получить возможность просмотра файлов в виде миниатюр, вместо списка, в файловом браузере GTK +.
Примеры
Пример настройки GTK+ 2:
GTK+ 3 пример настройки конвертации GTK+ 2.x в GTK+ 3.x с lxappearance :
Источник
Arch linux dark theme
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.
Contents
Installation
Three versions of GTK are currently available in the official repositories. They can be installed with the following packages:
- GTK 4.x is available with the gtk4 package.
- GTK 3.x is available with the gtk3 package.
- GTK 2.x is available with the gtk2 package.
- GTK 1.x is available with the gtkAUR package.
Themes
In GTK 3 and GTK 4, the default theme is Adwaita, but HighContrast and HighContrastInverse themes are also included. 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.
To force a specific theme, set the following environment variables:
- For GTK 3 and GTK 4, use GTK_THEME . For example to launch GNOME Calculator with the dark variant of Adwaita:
- For GTK 2, use GTK2_RC_FILES . For example to launch GIMP with the theme Raleigh:
More themes can be installed from the official repositories or the AUR. Manually extracted themes go in
Themes supporting GTK 2 and GTK 3:
- Adapta — An adaptive GTK theme based on Material Design Guidelines. Includes: Adapta, Adapta-Eta, Adapta-Nokto, Adapta-Nokto-Eta
https://github.com/tista500/Adapta || adapta-gtk-theme
- Arc — A flat theme with a modern look and transparent elements. Includes: Arc, Arc-Dark, Arc-Darker
https://github.com/jnsh/arc-theme || with transparency: arc-gtk-theme , without transparency: arc-solid-gtk-theme
- Bluebird — Blue Desktop Suite for Xfce.
https://github.com/shimmerproject/Bluebird || xfce-theme-bluebirdAUR
- Breeze — GTK version of KDE’s default widget theme. Includes: Breeze, Breeze-Dark
https://invent.kde.org/plasma/breeze-gtk || breeze-gtk
- Deepin — Default theme for the Deepin desktop. Includes: deepin, deepin-dark
https://github.com/linuxdeepin/deepin-gtk-theme || deepin-gtk-theme
- GNOME Extra Themes — Extra themes for the GNOME desktop. Includes: Adwaita, Adwaita-dark, HighContrast
https://gitlab.gnome.org/GNOME/gnome-themes-extra || gnome-themes-extra
- Greybird — A grey and blue Xfce theme, used by default in Xubuntu 12.04.
https://github.com/shimmerproject/Greybird || xfce-theme-greybirdAUR
- Materia — A Material Design-like flat theme for GTK3, GTK2, and GNOME-Shell.
https://github.com/nana-4/materia-theme || materia-gtk-theme
- MATE Themes — Default themes for the MATE desktop. Includes: BlackMATE, Blue-Submarine, BlueMenta, ContrastHighInverse, Green-Submarine, GreenLaguna, Menta, TraditionalGreen, TraditionalOk
https://github.com/mate-desktop/mate-themes || mate-themes
- Numix — A flat and light theme with a modern look (GNOME, Openbox, Unity, Xfce). Includes: Numix
https://github.com/numixproject/numix-gtk-theme || numix-gtk-theme-gitAUR
- Vertex — Theme for GTK 3, GTK 2, Gnome-Shell and Cinnamon.
https://github.com/horst3180/vertex-theme || vertex-themesAUR
- Zuki — Themes for GTK, gnome-shell and more.
https://github.com/lassekongo83/zuki-themes || zuki-themesAUR
There are a number of additional GTK themes in the AUR, example: search for gtk-theme.
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.
Configuration tools
Most major desktop environments provide tools to configure the GTK theme, icons, font and font size, and manage these settings via XSettings:
- If you use Cinnamon, use Themes tool (cinnamon-settings themes): go to System Settings > Themes.
- If you use Enlightenment: go to Settings > All > Look > Application Theme.
- If you use GNOME, use GNOME Tweaks (gnome-tweaks): install gnome-tweaks .
- If you use MATE, use the Appearance Preferences tool (mate-appearance-properties): go to System > Settings > Appearance.
- If you use Xfce, use the Appearance tool: go to Settings > Appearance.
Other GUI tools generally overwrite the configuration files.
Both GTK 2 and GTK 3 are supported:
- KDE GTK Configurator — Application that allows you to change style and font of GTK 2 and GTK 3 applications.
https://invent.kde.org/plasma/kde-gtk-config || kde-gtk-config After installation, kde-gtk-config can also be found in System Settings > Application Style > GNOME/GTK Application Style.
- LXAppearance — Desktop independent GTK 2 and GTK 3 style configuration tool from the LXDE project (it does not require other parts of the LXDE desktop).
https://wiki.lxde.org/en/LXAppearance || lxappearance-gtk3
- Oo-mox — Graphical application for generating different color variations of Numix and Flat-Plat themes (GTK 2 and 3), Archdroid and Gnome-Colors icon themes. Also allows generating pre-scaled GTK 2 themes for HiDPI displays.
https://github.com/actionless/oomox || themix-full-gitAUR
Only GTK 2 is supported:
Configuration
GTK settings can be specified manually in configuration files, but desktop environments and applications can override these settings. Depending on GTK version, these files are located at:
- GTK 2 user specific:
/.gtkrc-2.0
Basic theme configuration
To manually change the GTK theme, icons, font and font size, add the following to the configuration files, for example:
If the theme is not applied for GTK 3, use gsettings in addition:
Dark theme variant
Some GTK 3 themes contain a dark theme variant, but it’s only used by default when the application requests it explicitly. To use dark theme variant with all GTK 3 applications, set:
Keyboard shortcuts
Keyboard shortcuts (otherwise known as accelerators in GTK) may be changed by hovering the mouse over the respective menu item, and pressing the desired key combination. To enable this feature, set:
Emacs key bindings
To have Emacs-like key bindings in GTK applications add the following:
For GTK3 also run:
XFCE has a similar setting:
The config files in /usr/share/themes/Emacs/ determine what the Emacs bindings are, and can be changed. Copying sections to the users
/.gtkrc-2.0 file allows for changes on a per user basis.
GNOME menu delay
This setting controls the delay between pointing the mouse at a menu and that menu opening. This delay is measured in milliseconds.
Reduce widget sizes
If you have a small screen or you just do not like big icons and widgets, you can resize things easily.
To have icons without text in toolbars (valid values), use
To use smaller icons, use a line like this:
Or to remove icons from buttons completely:
You can also remove icons from menus:
Hide CSD buttons
To remove the client-side decorations (CSD)[3] minimize and maximize buttons from gtk3 windows:
Disable mouse paste
To turn off pasting on middle mouse button click (aka PRIMARY):
File-chooser start-up location
Open the file-chooser within the current working directory and not the recent location. Normally the current working directory is the Home directory.
Change setting with the following command:
Add the following to
Legacy scrolling behavior
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:
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 environment.
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 have not 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:
Examples
GTK example configurations:
GDK backends
GDK (the underlying abstraction layer of GTK) supports multiple backends to display GTK applications.
Wayland backend
The GDK Wayland backend is supported only by gtk3 and is the default backend when using Wayland display server.
Applications that use versions of GTK prior to gtk3 do not have wayland support, and need to use Xwayland in order to run on a wayland session using the X11 backend.
Xorg backend
If Xorg display server is in use, the backend defaults to x11 automatically.
It is possible to force GTK3 applications running on a wayland session to use the X11 backend through Xwayland by setting the environment variable GDK_BACKEND=x11 .
Broadway backend
The GDK Broadway backend provides support for displaying GTK applications in a web browser, using HTML5 and web sockets. [5]
When using broadwayd, specify the display number to use, prefixed with a colon, similar to X. The default display number is 0 (zero).
Port used by default
Alternatively can set address and port
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):
Theme not applied to root applications
As user theme files ( $XDG_CONFIG_HOME/gtk-3.0/settings.ini ,
/.gtkrc-2.0 ) are not read by other accounts, the selected theme will not apply to X applications run as root. Possible solutions include:
- Create symlinks, e.g
- Configure system-wide theme files: /etc/gtk-3.0/settings.ini (GTK 3) or /etc/gtk-2.0/gtkrc (GTK 2)
- Adjust the theme as root
- Use a settings daemon (this is what most desktop environments do). A desktop-agnostic variant using XSettings is available in the AUR under xsettingsd-gitAUR .
Client-side decorations
GTK 3.12 introduced client-side decorations, which move the title-bar away from the window manager. This may present issues such as double title-bars, no title-bar at all, double shadows with compositing enabled, or being unable to move a frozen application.
To remove the shadow and gap around windows (for example in combination with a tiling window manager), create the following file:
Note that if visual problems persist, you may want to use the GTK Inspector to find the offending elements as explained here [6].
To adjust the buttons in the header bar, use the gtk-decoration-layout setting. [7] The below examples removes all buttons:
To remove client-side decorations altogether, it’s possible to use a patched library like gtk3-classic AUR or gtk3-nocsd-git AUR .
cedilla ç/Ç instead of ć/Ć
See [8], and [9] for a workaround using Xcompose (US international layout).
Suppress warning about accessibility bus
If you do not use any Gnome Accessibility features, you may receive warnings like:
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:
Wrong focus events with tiling window managers
Define GDK_CORE_DEVICE_EVENTS=1 to use GTK2 style input, instead of xinput2. [11]
Thumbnail support for GTK file dialog
Install gtk2-patched-filechooser-icon-view AUR and gtk3-patched-filechooser-icon-view AUR to have the option to view files as thumbnails instead of list in the GTK file chooser.
Button and menu icons
The factual accuracy of this article or section is disputed.
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:
Simply set them to 0 or remove the whole file to use GNOME defaults.
GTK 3 without polkit
GTK3 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.
Patching GTK file chooser to use regular type ahead
GTK file chooser uses the same type-ahead-find feature as GNOME/Files. This can be very jarring and does not fit in very well with other desktop enviroments.
Some applications support XDG-desktop-portal which allows application to use the native file chooser. If that does not work you can restore type-ahead functionality by using a patched GTK, for example gtk3-classic AUR .
Text in GTK 4 applications is blurry or renders incorrectly
GTK 4 switched to to grayscale antialiasing without hinting when rendering fonts. There is no ability to switch back to the previous behavior. You can use gtk4-without-subpixel-hinting AUR to restore GTK 3 font rendering. GTK 4.6 will make a setting available that will restore some of the GTK 3 behavior. Subpixel antialiasing is not going to become available with this change.
Источник