AutoDarkMode / Windows-Auto-Night-Mode

Automatically switches between the dark and light theme of Windows 10 and Windows 11
GNU General Public License v3.0
7.3k stars 260 forks source link

How do I set the theme color to switch every 30 minutes? #875

Open billowssun opened 6 days ago

billowssun commented 6 days ago

Question

I need to switch between dark and light colors every 30 minutes and I don't know how I should set it up

yogeshwar-b commented 5 days ago

You can write another script that does this and just run it in the background.

Below is an example for Windows Batch file.

You need to update AutoDarkModeShell.exe path and seconds to wait , save it in a Something.bat file and run it in a console.

@echo off
:loop
echo 'Theme Switch initiated' %date% %time%
<path to AutoDarkModeShell.exe> --swap
timeout /t <seconds to wait> > NUL /nobreak
goto loop
billowssun commented 5 days ago

You can write another script to do this, just run it in the background.

The following is an example of a Windows batch file.

You need to update the path and wait seconds for AutoDarkModeShell.exe, save it in a Something.bat file and run it in the console.

@echo off
:loop
echo 'Theme switch initiated' %date% %time%
<path to AutoDarkModeShell.exe> --swap
timeout /t <seconds to wait> > NUL /nobreak
goto loop

Can't I just use the software's custom scripts to achieve this?

Spiritreader commented 2 days ago

You can write another script to do this, just run it in the background. The following is an example of a Windows batch file. You need to update the path and wait seconds for AutoDarkModeShell.exe, save it in a Something.bat file and run it in the console.

@echo off
:loop
echo 'Theme switch initiated' %date% %time%
<path to AutoDarkModeShell.exe> --swap
timeout /t <seconds to wait> > NUL /nobreak
goto loop

Can't I just use the software's custom scripts to achieve this?

The custom scripts are hooks when the theme changes, basically a callback. You can't configure the scripts to call a switch yourself, otherwise you would run into recursion problems.

So essentially, calling the ADM shell - like you're doing - from the outside is the correct way to do it.