DEV Community

Suhail
Suhail

Posted on • Edited on

Make non-Qt apps look native on Qt desktops

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.

Don't use the source code from the releases section — it's outdated. Instead, clone the repo. Then, 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!

Conclusion

Following the above steps will force GTK3 apps to use native Qt window decorations. However, there is no proper solution for GTK4 and Libadwaita apps as of yet.

Top comments (0)