Windows-Auto-Night-Mode
Windows-Auto-Night-Mode copied to clipboard
[Feature request] Add support to run script upon theme change
Hello! So I've been using this beautiful piece of software for quite some time (thanks a lot for coming up with this), and I am loving it. The recent addition of full theme change instead of just wallpaper was awesome! Sadly, I still have to modify some apps' themes manually. For example, for Spotify, I use spicetify to theme it - since spicetify is a cli utility, I have to run some commands to change my theme. I made a batch script to quickly change the config file and apply changes - it would be convenient if I could do it via this app; apps like WinDynamicDesktop can do it, so why not this?

Something like this would help a lot! Thanks for taking your time to read this!
Update: We investigate to this issue, to find a convenient and realiable solution.
Can WinDynamicDesktop only run PowerShell Scripts or also Batch Scripts? Or can you run Batch Scripts with PowerShell (Scripts)?
WinDynamicDesktop can only run powershell scripts, but one can call batch scripts with powershell scripts through line like ".\Test.bat"
Thanks!
There were some issues with the script file not updating correctly when the args lists were not populated. Also an issue was corrected where changing the working directory would not trigger a script re-run.
Build 10.0.2.17 should have addressed all of these issues.
Would it be possible to add an argument that indicates whether the light/dark mode was manually forced?
Thanks in advance.
Would it be possible to add an argument that indicates whether the light/dark mode was manually forced?
Thanks in advance.
The scripting engine is implemented using the standardized adm component. These components are unaware of the external switch state. If such a feature is provided, the components should be able to handle switch events as a whole, which requires modification to the component interface and switching logic, which is quite a lot of work.
In addition, it would need to be defined if adm passes parameters (and if, how) or whether script entries have a configuration option that allows to speficy event triggers.
Moreso, the automatic vs manual switching indicator in the log file is not really production ready for such purposes and is just meant as a quick debugging tool to spot rudimentary switching sources.
Unless there is a lot of demand from many users for this feature, I would tend to say no, it's not possible for now.
The reason I'm asking for this is that I want to kill the touch keyboard process when I manually force a mode as mentioned here https://github.com/AutoDarkMode/Windows-Auto-Night-Mode/issues/347, but I don't want that to happen during an automated scheduled switch, when I might be in the middle of typing something with that keyboard.
The idea to propagate events within ADM has been discussed before, but I don't believe that your specific problem (which stems from a Windows bug in the first place) warrants a complete rewrite of the ThemeManager.
Without providing any ETAs, this revamp will likely happen eventually though.
Understood.
@WindowsTablet I've invested the time and rewrote the thing anyway, because it probably needed to be done at some point. You can find infos on how to specify the script trigger source in the wiki. The feature is availalbe starting with Beta 10.0.2.21.
Marking this as complete as the scripting engine is working, albeit with no UI. Will open a separate issue for that for logical separation