CyberT17 / obsidian-day-and-night

An Obsidian plugin to automatically switch between day and night themes based on a set schedule
MIT License
13 stars 1 forks source link

Respect the system mode #12

Open slavamak opened 10 months ago

slavamak commented 10 months ago

Is there any way to do so to respect the system theme? Instead of manually setting the schedule in plugin. I mean if I have automatic theme switching enabled in the system. The problem is that macOS automatically switches it from sunset to sunrise based on my location, but in the plugin schedule fixed and in this case I need to sync it every time.

Screenshot 2023-11-05 at 9 31 57 PM
a13ph commented 10 months ago

I'm pretty sure that to follow system theme you can just use native Obsidian setting:

→ Settings → Appearance → Base color scheme → Adapt to system

slavamak commented 10 months ago

@a13ph yeah, but I want to use different themes for light and dark mode, that's why I chose this plugin. Unfortunately obsidian doesn't provide settings for it. We can select only one theme.

CyberT17 commented 10 months ago

I am not sure if there is a way to get the system theme schedule using the Obsidian API. I'll spend some time researching and see if this is possible.

slavamak commented 10 months ago

I suppose we could add the option to settings, and then use window.matchMedia to detect the colorscheme mode in the system. If it make sense :)