Change the theme of the Qt5 app to make it look native on Ubuntu 20.04

Did you find Qt5-based applications (VLC, qBittorrent, Virtualbox, Audacious, etc.) ugly on your Ubuntu desktop? This is because it does not inherit the global GTK theme.

You can apply custom themes to your Qt5 application to make it look native on your Ubuntu Gnome desktop. And Kvantum, an SVG-based theme engine, can do the job.

First, let’s look at the changes before and after applying the changes.

And here is a step-by-step guide showing how to do this on Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10.

1. Open first terminal (Ctrl + Alt + T) Then run the command to add the PPA:

sudo add-apt-repository ppa:papirus/papirus

This step is optional starting with Ubuntu 20.04, as the package has already been created in the main repository.

2. Install qt5-style-kvantum Run command to package:

sudo apt install qt5-style-kvantum

3. Add a rule to your profile so that the theme engine handles single-user Qt apps.

echo "export QT_STYLE_OVERRIDE=kvantum" >> ~/.profile

If global, you can edit /etc/environment Create a file and add a line export QT_STYLE_OVERRIDE=kvantum Finally as a line break.

4. Log out and log back in. Then launch Kvantum Manager from the System App menu. Go to “Change / Remove Theme” and select and apply the KvYaru theme.

Now the Qt5 app should look native when running with the default Yaru GTK theme.

Uninstall and restore your changes.

To uninstall the PPA, open a terminal and run the following command:

sudo add-apt-repository --remove ppa:papirus/papirus

To remove the theme engine, run the following command:

sudo apt install qt5-style-kvantum qt5-style-kvantum-themes

And don’t forget to edit ~/.profile Delete the last line.

gedit ~/.profile

Related Posts