Color scheme: adapt to system not working on Linux (Fedora/GNOME)

Steps to reproduce

  1. Have a light theme set on the system
    • on Fedora, this means e.g. going to GNOME Tweaks → AppearanceThemesApplications and selecting a theme from the drop-down
  2. Launch Obsidian
  3. Check that OptionsAppearanceBase theme has the value “Adapt to system”
  4. Change the system theme from a light theme to a dark theme
    • in my case, this would be Materia-light-compact → Materia-dark-compact, but I also tested this on the default GNOME theme (Adwaita → Adwaita Dark)

Expected result

Obsidian should adapt its color scheme to the system theme and switch to the dark color scheme.

Actual result

Obsidian’s color scheme remains light.

Environment

  • Operating system: Fedora 35
  • Desktop environment: GNOME 41.5
  • Windowing system: X11
  • Debug info:
SYSTEM INFO:
	Obsidian version: v0.14.15
	Installer version: v0.14.6
	Operating system: #1 SMP PREEMPT Wed Apr 20 15:37:53 UTC 2022 5.17.4-200.fc35.x86_64
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: light
	Community theme: none
	Snippets enabled: 1
	Safe mode: on

Additional information

Other applications such as Firefox and Visual Studio Code do adapt their theme to the system theme, so I think this should be doable for Obsidian as well (especially since VS Code uses Electron too).

Here are two illustrative screenshots of the problem:


Does it work if you close and reopen obsidian?

Also download and reinstall obsidian (appimage or snap)

Does it work if you close and reopen obsidian?

Seems like it does, it did no occur to me that I had to restart the app for it to work! So I guess what I’m looking for is that Obsidian should adapt to the theme immediately just like my other apps do. Obsidian also updates the scheme instantly on Windows, without a relaunch, and I would expect the same to happen here.

I have configured my system theme to change based on the time of the day, so I consider it an important feature to have my apps adapt to that setting without having to perform any extra steps.

Do you have to restart for every dark/light change, or just once to make the setting work?

Every change. Which defeats the purpose of the “adapt to system” setting for me, since at that point you could just toggle the dark/light mode via a hotkey if it’s going to require manual intervention each time anyway.

Ouch, annoying. As a workaround, you could try the System Dark Mode community plugin. I don’t know if it’ll work on your system, but I used it before Obsidian had that setting. (Er, actually I see I’m still using it — I guess I can turn it off now.)

I’ve tried that plugin before, and unfortunately it has the exact same problem on Linux, the theme only changes on restart. I believe Obsidian’s own implementation is actually based on that plugin since they specifically thanked the plugin developer in the release notes.

I have now tried reinstalling Obsidian as suggested by WhiteNoise (although Fedora uses Flatpak instead of Snap):

sudo flatpak remove md.obsidian.Obsidian
sudo flatpak install md.obsidian.Obsidian

I then created a fresh vault, and enabled the “adapt to system” setting, but the issue persists.

I also tried the same with the AppImage distribution, the problem exists with that as well. So this is most likely not a packaging-dependent bug.

To confirm that this bug isn’t just something weird in my environment, I’ve reproduced the bug on a fresh installation of Ubuntu 20.04.4 LTS (GNOME 3.36.8, X11). Changed the theme from Yaru to Yaru-dark → Firefox and VS Code adapt instantly, Obsidian does not (until after a restart).

I tested all the supported installation methods for Ubuntu (Snap, AppImage, and deb).

I hope this helps the developers in some way.

I had this issue on a Mac. Turns out I had set system appearance to light and changing it to auto fixed the issue for me.

thanks

Hi, same issue here on the same system (Fedora 36 workstation, GNOME 42.2, using Wayland).
Any solutions?

Also, I wanna commend @ecchina_ko for the excellent bug report :wink:

1 Like

I guess you could schedule a script to restart Obsidian at the same time of the day your system theme changes. This is, of course, not optimal, and could get in the way if it happens to restart just when you’re actively using the program.

1 Like