Comments (2)
Hey, thanks for the detailed report!
I also noticed that [TimeSwitchModule] is also triggered at system startup, and the current theme is recognized as Unknown:`
At startup, ADM has no way of knowing which state the system is in when it comes to user scripts as it can't track what the user is doing when the application is not active.
So it will run the scripts once at startup to bring the system into a known state.
That is normal.
The reason you're not seeing the SystemUnlock event triggering your script is actually not because the trigger defective, but because there is a
2024-01-08 16:28:45 | Info | ThemeManager.UpdateTheme: dark theme switch performed, source: SystemTimeChanged
event that predates the trigger events you are looking to use.
Since you're on Windows 10 and you have
Win10AllowLockscreenSwitch: true
enabled, the system time change will "eat" the event.
See: 776a22f
I've pushed a new beta build that fixes a DWM refresh issue with the theme mode that you encountered, as well as disallowing time synchronization theme switches to occur during the lock screen, which should yield the correct event.
It also fixes theme application at system unlock with the theme mode when the active target theme was already correct by introducing an additional synchronization.
Lemme know if that fixes your issue. What you're experiencing is sort of a cumulative result of multiple little bugs with the theme mode, gotta squash them one by one.
from windows-auto-night-mode.
Since you're on Windows 10 and you have
Win10AllowLockscreenSwitch: true
enabled, the system time change will "eat" the event.
Indeed, after disabling that, it now works correctly.
<Theme Switcher time change to 18:07>
2024-01-12 18:05:17 | Debug | AdmConfigMonitor.PerformConfigUpdate: updated configuration from file
2024-01-12 18:05:17 | Info | MessageParser.Parse: signal received: invoke theme switch request
2024-01-12 18:05:17 | Info | ComponentManager.GetComponentsToUpdate: components queued for update: [ScriptSwitch]
2024-01-12 18:05:17 | Info | ThemeManager.UpdateTheme: dwm management: full refresh requested by user
2024-01-12 18:05:17 | Info | ScriptHandler.Launch: running ADM_scripts_Loader (Manual): "powershell" "-ExecutionPolicy" "Bypass" "-File" ".\#ADM_scripts_Loader.ps1" "-Manual"
2024-01-12 18:05:21 | Info | Tm2Handler.SetTheme: applied theme ADMUnmanagedLight, from origin: C:\Users\wz\AppData\Local\Microsoft\Windows\Themes\light.theme directly via IThemeManager2
2024-01-12 18:05:21 | Info | ThemeManager.UpdateTheme: light theme switch performed, source: Manual
2024-01-12 18:05:23 | Info | ScriptHandler.Launch: ADM_scripts_Loader (Manual)'s output:
================== Start ==================
Src: Manual
[#scripts\qBittorrent.ps1]
[#scripts\YF2_W11.ps1]
=================== End ===================
2024-01-12 18:05:23 | Info | ScriptSwitch.HandleSwitch: update info - previous: Dark, now: Light
2024-01-12 18:05:34 | Debug | PostponeManager.Add: added SessionLock to postpone queue: [SessionLock]
<Sleep or Hibernate>
2024-01-12 18:08:35 | Debug | SystemEventHandler.SystemEvents_RefreshPostponeTimers: resynchronizing postpone timers with system clock after resume
2024-01-12 18:08:48 | Debug | PostponeManager.Remove: removed SessionLock from postpone queue: []
2024-01-12 18:08:48 | Info | PostponeManager.Remove: postpone queue cleared
2024-01-12 18:08:48 | Info | SystemEventHandler.SystemEvents_Windows11_SessionSwitch: system unlocked, refreshing theme
2024-01-12 18:08:48 | Debug | RegistryHandler.GetActiveThemePath: current theme tracked by windows: ADMUnmanagedLight, path: C:\Users\wz\AppData\Local\Microsoft\Windows\Themes\ADMUnmanagedLight.theme
2024-01-12 18:08:48 | Info | ComponentManager.GetComponentsToUpdate: components queued for update: [ScriptSwitch]
2024-01-12 18:08:48 | Info | ThemeManager.UpdateTheme: dwm management: full refresh requested by user
2024-01-12 18:08:48 | Info | ScriptHandler.Launch: running ADM_scripts_Loader (SystemUnlock): "powershell" "-ExecutionPolicy" "Bypass" "-File" ".\#ADM_scripts_Loader.ps1" "-SystemUnlock" "-Dark"
2024-01-12 18:08:52 | Info | Tm2Handler.SetTheme: applied theme ADMUnmanagedDark, from origin: C:\Users\wz\AppData\Local\Microsoft\Windows\Themes\dark.theme directly via IThemeManager2
2024-01-12 18:08:52 | Info | ThemeManager.UpdateTheme: refreshed dark theme, source: SystemUnlock
2024-01-12 18:08:54 | Info | ScriptHandler.Launch: ADM_scripts_Loader (SystemUnlock)'s output:
================== Start ==================
Src: SystemUnlock
[#scripts\qBittorrent.ps1] -Dark
[#scripts\YF2_W11.ps1] -Dark
=================== End ===================
2024-01-12 18:08:54 | Info | ScriptSwitch.HandleSwitch: update info - previous: Light, now: Dark
from windows-auto-night-mode.
Related Issues (20)
- Add bule light 'filter' and brightness controls/sliders. HOT 2
- Manual toggling HOT 2
- Cannot be used with Rectify11 HOT 1
- Light mode not activated back HOT 4
- Spotlight background setting in theme file not persisted HOT 3
- Changing background is not working HOT 8
- Recommendations for the list of compatible apps HOT 6
- Add compatibility and integration to switch themes with Rectify11 theme features HOT 2
- Ability to add accent colour to taskbar in light mode HOT 1
- The theme switcher does not automatically switch the time HOT 4
- Suggestion for Next Updates HOT 1
- Taskbar Accent Color for Both Modes HOT 8
- Running a bat file through the script
- Toggling theme changes desktop background colour even though not configured HOT 2
- ADM (presumably) generated a file 'overrides.json' on Desktop HOT 2
- bug menu HOT 1
- Control Panel HOT 1
- Add ability to switch mode based on Battery saver on/off status HOT 3
- The apps offer update to latest version although its a last version. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from windows-auto-night-mode.