Dark themes for GTK and QT5 applications
🕐 2 minutes
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.
$: doas pkg install gtk-arc-themes lxappearance
We open now lxappearance and we can choose the arc-dark here.
Next, we need the ports
Install and we 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 used just like gtk applications.