A PowerShell module for switching Windows 10 and MacOS Mojave between light and dark themes depending on whether it is day or night.
Windows:
macOS:
This module is published in the PowerShell Gallery, so can be installed via:
Install-Module Lumos
You can manually trigger Lumos as follows:
Invoke-Lumos
On Windows, this 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.
On MacOS Mojave, using Invoke-Lumos
with no switches will switch the theme to its alternate, i.e if it's Light it will switch to Dark and if Dark switch to Light.
You can also simply use the alias Lumos
.
You can explicitly specify whether you want the Dark or Light modes on both Windows 10 and MacOS Mojave with the following switches:
Invoke-Lumos -Dark
Invoke-Lumos -Light
By default the cmdlet will change both the System and Application themes, but on Windows 10 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 -ExcludeApps
These switches are not available on MacOS Mojave.
If you'd like your wallpaper to change with the theme (on Windows 10 or MacOS Mojave), you can specify a path to these:
Invoke-Lumos -Dark -DarkWallpaper c:\wallpaper\dark.png
Invoke-Lumos -Light -LightWallpaper /Users/markwragg/Pictures/light.jpg
If you'd like change the theme of your Office ProPlus installation on Windows 10, you can pass the -IncludeOfficeProPlus
flag. It will update your Office Clients to switch to either the Dark or Light mode. Note that it requires a restart of your Office Applications before it takes effect.
Invoke-Lumos -Dark -IncludeOfficeProPlus
If you'd like Windows 10 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 (this cmdlet does not currently support MacOS Mojave):
Note this may require your PowerShell terminal to be running as Administrator.
Register-LumosScheduledTask
Note 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.png
Note 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.