A PowerShell module for switching Windows 10 between light and dark themes depending on whether it is day or night.
This module is published in the PowerShell Gallery, so can be installed via:
Install-Module LumosYou can manually trigger Lumos as follows:
Invoke-LumosThis will get your geographical coordinates from your local system and then use these to query a web API for the sunrise and sunset times for your location. If the sun is down, the theme will be set to dark. If the sun is up, the theme will be set to light.
You can explicitly specify whether you want the Dark or Light modes with switches:
Invoke-Lumos -Dark
Invoke-Lumos -LightBy default the cmdlet will change both the System and Application themes, but if you'd like to just change one of these you can exclude the other by using these switches:
Invoke-Lumos -Dark -ExcludeSystem
Invoke-Lumos -Light -ExcludeAppsIf you'd like your wallpaper to change with the theme, you can specify a path to these:
Invoke-Lumos -Dark -DarkWallpaper c:\wallpaper\dark.png
Invoke-Lomus -Light -LightWallpaper c:\wallpaper\light.pngIf you'd like Windows to automatically switch from Light to Dark mode based on your local sunrise/sunset times, you can use the following cmdlet to add a Scheduled Task to do so:
Note this may require your PowerShell terminal to be running as Administrator.
Register-LumosScheduledTaskNote you can specify all the above switches when doing this to customize the result. For example:
Register-LumosScheduledTask -ExcludeApps -DarkWallpaper c:\wallpaper\dark.png -LightWallpaper c:\wallpaper\light.pngNote that each time the scheduled task runs it will invoke the Update-LumosScheduledTask cmdlet to change the timings of the triggers to reflect the latest sunrise/sunset times for your locale.
