Dark themes for GTK and QT5 applications

In this tutorial, I will explain how to install a nice dark theme.

QT5 and GTK are used to create the graphical user interface for applications. They each have their appearance, depending on the theme and symbols installed.

So installing a dark GTK theme doesn't change the look of QT5 applications like VLC and QBittorrent.

To create a more consistent look and feel for applications, we'd like both gtk and qt5 to use a dark theme.

We installed the package gtk-arc-themes, which contains the theme adwaita-dark, and the packages lxappearance to set the dark theme for GTK applications.

$: doas pkg install gtk-arc-themes lxappearance

We open now lxappearance and we can choose the arc-dark here.

Next, we need the ports

$: doas pkg install adwaita-qt5 qt5-style-plugins qt5ct

Install and activate the dark theme for qt5-based applications.

We then add the following code to our .xinitrc-this is needed for the qt5ct program which we can use to configure which theme qt5 applications use.

$: nano ~/.xinitrc =>

export QT_QPA_PLATFORMTHEME=qt5ct

Now we need to restart the computer. If we open the qt5ct program before restarting, the variable will not be recorded, and we will not be able to change the subject.

After the restart, we open the qt5ct program and change the design to the qt5 version of adwaita-dark.

We can open the qt5ct program with an application launcher like dmenu or rofi when you use it.

We'll use the Appearance tab, the drop-down menu, next to the word style. Likewise, we'll select Adwaita-Dark, then click Apply.

Let's go to the Fonts, tab and we'll change the font to Sans Serif 10. We click Apply and OK to close qt5ct.

Now, when we open qt5-based applications like vlc and qbittorrent, the Adwaita Dark theme is used just like gtk applications.

Discuss...