DEV Community

Cover image for Forced Switching to Adwaita Light Theme
Naufan Rusyda Faikar
Naufan Rusyda Faikar

Posted on

5 4

Forced Switching to Adwaita Light Theme

Just another short story ...

I love theme Adwaita theme, especially the dark one. So, I always have it enabled by using GNOME Tweaks. Unfortunately, many applications do not seem to be worked pretty well in dark theme. So, I wanted to know how to run certain Flatpak application in light theme without me changing the global default theme.

In my case, WPS Office has a poor display of the font search dropdown list; black text on dark background will never be good. After googling for a while, I got to know that WPS Office was installed at /var/lib/flatpak/app/com.wps.Office/. It seemed like all Flatpak applications will be installed either at

  • /var/lib/flatpak/app/ for system-wide installation; or
  • ~/.local/share/flatpak/app for per-user installation.

Exploring the directory structure, I have realised that somehow WPS Office has included its own theme directory at /var/lib/flatpak/app/com.wps.Office/x86_64/stable/active/files/share/themes/.

$ cd /var/lib/flatpak/app/com.wps.Office/x86_64/stable/active/files/share/themes/
$ ls
Adwaita  Adwaita-dark  Default  Emacs  HighContrast  Raleigh
Enter fullscreen mode Exit fullscreen mode

I think, this is not common, at least not for most applications. Then, I idly experimented to remove the Adwaita-dark folder, so that WPS Office cannot find it anymore. Or at least just to rename it;

$ sudo mv Adwaita-dark/ Adwaita-dark-bk/
$ sudo mv Adwaita/ Adwaita-dark/
Enter fullscreen mode Exit fullscreen mode

Fortunately, it seemed to be worked. Yay! I have managed to force WPS Office to use the light theme instead! Although I cannot explain it.

For GTK applications, we can make sure to set the GTK_THEME environment variable. For example, for the Color Picker application:

$ sudo flatpak override --env=GTK_THEME=Adwaita nl.hjdskes.gcolor3
Enter fullscreen mode Exit fullscreen mode

To unset, just need to set the value to empty:

$ sudo flatpak override --env=GTK_THEME= nl.hjdskes.gcolor3
Enter fullscreen mode Exit fullscreen mode

For Qt applications, set the QT_STYLE_OVERRIDE variable instead.

You deserve a good day, bye!

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay