installing gtk and qt5 dark themes

How to install and set up gtk and qt5 dark themes

QT5 and GTK are used to create the graphical user interface for applications,
they each have there own look which is determined by the theme and icons installed

So installing a dark gtk theme wont change the look of qt5 applications like vlc and qbittorrent

To create a more uniform look for applications we want both gtk and qt5 to use a dark theme

switch to root using either sudo or doas

switch to root using sudo

Bash:
sudo su

or use doas to switch to root

Bash:
doas su

the hash symbol # before a command indicates that the command needs to be run as root

Install the gtk-arc-themes package which contains the adwaita-dark theme

Bash:
# pkg install gtk-arc-themes

create the ~/.config/gtk-3.0/settings.ini file

Bash:
vi ~/.config/gtk-3.0/settings.ini

set gtk apps to use the Adwaita-dark theme by adding the code below to the settings.ini file

Bash:
[Settings]
gtk-applications-prefer-dark-theme=0
gtk-theme-name = Adwaita-dark

Next we need to install adwaita-qt5 qt5-style-plugins qt5ct,
and enable the dark theme for qt5 based applications

Bash:
# pkg install adwaita-qt5 qt5-style-plugins qt5ct

if you use bash as your shell edit your ~/.bashrc

Bash:
vi ~/.bashrc

if you use zsh edit your ~/.zshrc file

Bash:
vi ~/.zshrc

then add the code below to your shells config file,
this is needed for the qt5ct program which lets you configure which theme qt5 applications use

Bash:
export QT_QPA_PLATFORMTHEME=qt5ct

now we need to reboot the computer before it will pick up the QT_QPA_PLATFORMTHEME variable in our shell config file,
if you open the qt5ct program before you have rebooted it wont pick up the variable and let you change the theme

after you have rebooted we will open the qt5ct program and change the theme to the qt5 version of adwaita-dark

you can open the the qt5ct program using an application launcher like dmenu or rofi if you use then,
or on the command line by running qt5ct

Code:
qt5ct &

On the Apperance tab use the drop down menu next to the word style and select Adwaita-Dark and then click apply

adwaita-dark.png


Switch to the Fonts tab and change the font to Sans Serif 10 click apply and ok to close qt5ct

fonts.png


Now if you open qt5 based applications like vlc and qbittorrent they will use the Adwaita Dark theme just like gtk applications

VLC Adwaita Dark theme

vlc.png


qbittorrent Adwaita Dark theme

qbitorrent.png


GTK applications using Adwaita Dark

Emacs menu using Adwaita Dark gtk theme

note the emacs menu and toolbar now use gtk3 themes for the style,
but the rest of the interfaces style uses your ~/.xinitrc

emacs.png
 
Hi comrade and thanks for the post,however i use tcsh and csh. Is there a way to do it there because 'export' doesn't exist in .cshrc
 
I only needed to add this:
Code:
[Settings]
gtk-application-prefer-dark-theme=1
gtk-theme-name=Adwaita
To ~/.config/gtk-3.0/settings.ini. Note that the name of the setting is gtk-application-prefer-dark-theme. There is no "s".

The Adwaita theme and its dark variant were already installed. I do not have gtk-arc-themes installed.
 
To launch a single application with the light theme do something like
Code:
GTK_THEME=Adwaita:light thunderbird
 
Back
Top