Sublime Forum

How can I toggle ST4's light/dark mode switch on Linux?

#1

I am using the i3 window manager on top of Ubuntu (although considering migrating to Manjaro at some point) with a highly customized theming system I made that uses Pywal. I wrote a script which does its best to change themes within apps that support theming, and tries to switch light/dark mode in the apps as well. My current solution for Sublime Text is to modify my preferences file with a light or dark theme and color scheme depending on what I want. I could continue doing that, but given Sublime Text 4 has the automatic theme I think it would be better to toggle that instead. The problem is that my desktop environment is home grown and doesn’t have a standard way to toggle that.

Please let me know if this is possible or if anyone has suggestions, thanks!

0 Likes

#2

To check for dark mode we query the active gtk theme’s background color. So if the currently set gtk theme has a dark background we switch to dark mode.

1 Like

#3

Ah, that checks out! I’ll have to tackle that part of my setup then. Thank you!

0 Likes