Uniform look for Qt and GTK applications on Sway (Wayland)
There are several techniques to achieve a uniform look (theme and style) of Qt and GTK to circumvent the fact they use a different widget toolkit to render the graphical user interface.
On X11, I used the QGtkStyle method (described in the Wiki) to style Qt applications using the GTK theme.
On Sway (Wayland), this approach only works for Qt applications (*) that use XWayland. It does not work for Qt applications that run natively on Wayland.
Does anyone know a workaround that also works for Qt applications running natively on Wayland (and not on Xwayland)?
(*) For example, qtbrowser is such an application.
About this post
- Posted
- Archived
- Score
- 69 · 100% up
- Kind
- Text
- ID
- do8vde
7 comments
Not sure why you are getting downvoted, uniform look for QT and GTK applications under Wayland is an issue I've stumbled upon as well without finding a proper solution, so I would be interested in the answer as well.
Also in the Wiki, on that same page: Styles for both Qt and GTK. IMO adwaita has become a really nice-looking theme, so I now use it as my gtk theme in conjunction with adwaita-qt from the aur (via
QT_STYLE_OVERRIDE).And because adwaita is the official gnome/gtk theme, it's really reliable, unlike most of the custom themes out there.
I use
QT_QPA_PLATFORMTHEME=qt5ctYou need to install qt5ct and execute it to customize qt5 applications.
Set the
XDG_CURRENT_DESKTOPenvironment variable toKDE(andKDE_SESSION_VERSIONto5, although I'm not sure if it's needed for this purpose), then use KDE's system settings (systemsettings5) to set the theme.Here is my backend/theming setup. Seems to do well most of the time for consistency across GTK and Qt. Works well enough that I get confused which is which if Thunar and pcmanfm are both open, so that's something at least.
Where "qt5ct" is from the AUR, and is configured to also use an adwaita dark theme.
Deleted before we saved it.