Giter Club home page Giter Club logo

Comments (2)

Spiritreader avatar Spiritreader commented on June 10, 2024 1

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.

wvzxn avatar wvzxn commented on June 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.