DEV Community

svhl
svhl

Posted on • Edited on

Make non-Qt apps look native on Qt desktops

Update: There's a newer (and better) method to theme not just GTK3 apps, but also GTK4/Libadwaita. Check out GTK-NoCSD by MorsMortium, which is actively maintained with consistent improvements.


Theming non-Qt apps is essential on Qt desktops like KDE Plasma or LXQt if you don't want them to stick out. How easy it is to do depends on the GTK version the app uses.

This is a guide for Lutris, but it should work for any other GTK3 app.

How to do it

First, install gtk3-nocsd from GitHub.

The latest release is outdated, so don't use it. Instead, clone the repo, install dependencies and build according to the instructions mentioned on GitHub.

This is enough to remove the CSD, but there are still a few issues.

Main page
A thin line spanning underneath the titlebar

Settings page
Some titles and buttons are duplicated

To solve these, edit your ~/.config/gtk-3.0/gtk.css file and add the lines below.

decoration, decoration:backdrop {
    box-shadow: none;
}
.title {
    color: transparent;
}
.titlebar,
.titlebar .background,
decoration,
window,
window.background {
    border-radius: 0;
    border: 0px;
    box-shadow: none;
}
Enter fullscreen mode Exit fullscreen mode

Also, remove the url content of the first three lines of ~/.config/gtk-3.0/window_decorations.css. This won't remove the close button, but it will make it invisible.

headerbar button.titlebutton.close, .titlebar button.titlebutton.close {
  background-image: url(""); }

headerbar button.titlebutton.close:hover, .titlebar button.titlebutton.close:hover {
  background-image: url(""); }

headerbar button.titlebutton.close:active, .titlebar button.titlebutton.close:active {
  background-image: url(""); }
Enter fullscreen mode Exit fullscreen mode

The changes in this file will get reverted, so make the file immutable by running

sudo chattr +i ~/.config/gtk-3.0/window_decorations.css
Enter fullscreen mode Exit fullscreen mode

The Qtfication is now complete!

Top comments (0)