Auto VS Code Themes

How to automatically change your VSCode theme based on the time of day.

I don't buy into the whole "dark mode v light mode" debate. I think both are great, and I use both. Specifically, I use dark mode at night, and light mode during the day.

I don't know the long-term effects of this, so I might change my mind in the future.

I have my PC's theme set to change based on the time of day, and recently, I thought to myself, "Why not do the same for VS Code?"

A bit of digging, and turns out it's easy to do.

Open your VS Code's settings.json, set window.autoDetectColorScheme to true, and you're done!

		{
	"window.autoDetectColorScheme": true
}
	

All that's left to do, is specifying which theme to be applied when. Personally, I use one theme provider - BeardedBear.

I use their "Bearded Theme Arc Reversed" theme at night, and their "Bearded Theme Light" theme during the day. So, my settings.json looks like this:

		{
	"window.autoDetectColorScheme": true,
	"workbench.preferredDarkColorTheme": "Bearded Theme Arc Reversed",
	"workbench.preferredLightColorTheme": "Bearded Theme Light"
}
	

And that's it! Now, your VS Code theme will change based on the time of day, or, whenever you toggle your PC's theme - God knows I tend to do that a lot 😅.