-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
light/dark mode switch based key, on time or sunset/sunrise #1331
Comments
We're prioritizing v1 work items but if a community member wants to help build this out, happy to dedicate time to this. |
Really like this idea! Here's a mock-up for the settings screen this feature would need to have. XAML source (WinUI 3.0 Alpha) in this repo: https://github.com/niels9001/PowerToysUXWinUI3Alpha |
It’d also be very nice if we could choose two existing themes and set each one for day/night time (so not only the Light/Dark theme is changed, but also the wallpaper) |
Somebody referenced this project that does this: https://github.com/Armin2208/Windows-Auto-Night-Mode |
Cool project but that is GPL v3. We cannot use any source code from that project due to that license. |
I do this in EventGhost using registry and cmd. Just chipping in case it helps. Light: CMD: "%localappdata%\Microsoft\Windows\Themes\Day.theme" Dark: CMD: "%localappdata%\Microsoft\Windows\Themes\Night.theme" |
Thanks @mikeparkie! Investigation is a massive part of the work!!! |
I also use the exact commands @mikeparkie referenced. I think I found them through a Google search, but I can confirm it works. I use Task Scheduler; the action is 'Start a Program', command One quirk I've noticed with this method: if you leave a File Explorer window open during the change, most of the Explorer UI honors the switch--the 'folder contents' portion of the window does not. It requires closing the File Explorer window and opening a new one to produce the expected result of a fully themed Explorer window. Point is, it works, but it's not always elegant (not sure if it's possible to force reload the open windows entirely?) |
@bradleybowman agreed, it's relatively crude in it's execution, but it works for the most part. And actually I didn't face any issues with the UI, other than the ribbon redraws first, followed by the rest of the frame/contents, take about 2 seconds in total. Enough to notice a transition. If it's a content/icon refresh, then theres always the "ie4uinit.exe -show" command which should reload the icon cache (but I'm guessing a little there). |
Wrong @ in the comment
|
@BradleyBartlett whoopsie, sorry about that :) |
Luna is a new project up on GitHub that does this.. Light-weight and made with WPF. MIT license (@crutkas) |
@mikeparkie I noticed last night when the theme switched, it did redraw the File Explorer window properly. It's probably worth noting I'm on the 'Insider Fast Ring', so there's always the factor that I'm on a potentially unstable build. @niels9001 I checked out Luna. The interface is slick and in my opinion just how an average end user would like to set up light/dark mode switching If you check through that project though, it's essentially doing the same thing I am. Luna creates the Task Scheduler tasks at the times you select, and if you check out Luna/Helpers/RegistryHandler.cs: (Hopefully I'm allowed to crosspost this, if not please let me know and I'll remove)
^ It uses the same method that Mike and I mentioned. Nothing against the Luna app, I really do like the interface...it just seems that, at present, theme switching falls into the 'registry hack not-elegant-but-it-works' category |
@bradleybowman likewise, I'm also running fast ring insider builds. I can't whether my previous non-insider builds had the issue or not. I'm not rebuilding to test it out :) |
@bradleybowman No problem, I'm excited about this. It's a 'small' feature but I think a lot of users would be happy with it. Are you guys planning to pick this up? I'd be happy to help with the XAML/UX within Settings. |
As others have mentioned above I also use the Registry value triggered at specific times in the task scheduler to toggle on dark mode at night. However - I also use this registry key as well to make sure dark/light mode is applied to Windows:
|
Hello! I am the developer of the Auto Dark Mode App for Windows. I am interested in working together as I could change the license. Especially creating a new public theming API would be in the interest of all of us. In return of sharing my code with you I need some help. How can I contact you? |
cc @crutkas |
@Armin2208, lets chat! [email protected] |
I had the exact same idea (connecting light/dark theme to Nightlight) a while ago. I sent in the suggestion via Windows Feedback hub. Seems like the best place for this idea, to me - really hoping it'll make it's way into Windows some day. But when Windows itself does not have this option, PowerToys looks like a good alternative. |
My guess is that many people stopped using f.lux when they added night light to Windows. |
Will this include a hotkey to manually toggle dark mode? Tha's really all I'm looking for. |
I'm currently starting the implementation of such a module. I am planning on doing something very similar to Night light on Windows 11. Here is a brief overview of the features I am planning to implement:
|
Aweeeesome 😄🔥. Would it make sense to, instead of systray, put the toggle in the PT quick access flyout? It's an additional click, but does save space in the systray area - and it's not something you'd press 10 times a day 😄 |
@niels9001 yes, that's another good option. I was thinking of a dedicated tray item (that we can disable) for ease of access by users that are more mouse-oriented. I'd like to facilitate my team to test our app and toggle theme easily. But perhaps it is a bit overkill. |
Wow, that sounds awesome! I have two questions: |
Been looking for this to exist in PT since Windows doesn't have this natively - I think this a perfect place/tool for such a feature. Glad to hear its being worked on! Happy to help in any way I can |
@Spiritreader I don't think I can say anything about Microsoft's stance. I won't use any private APIs. I'll probably have to use the hacks discussed in this thread. I am not aware if there is any work or plan for creating a public theme switching API. PowerToys is just the perfect place to introduce such feature if we want it to eventually be picked up by Windows. |
I have installer Powertoys v.0.81.0 but I cannot find the auto dark mode feature. Is it available or is it still a WIP? :) |
|
If you see the Test for PowerToys project and Help wanted project, to which this issue/feature has been added, this makes me think WIP does not describe the status accurately. Unless @SamChaps or someone else is working on this in the background, it looks like no one is currently working on this and there is nothing currently "in progress" on this feature. |
I will be working on this. |
The features in auto dark mode seem very good a relevant to this application - https://github.com/AutoDarkMode/Windows-Auto-Night-Mode Auto Dark Mode has a range of customization options. You can set custom hours for theme switching, create exceptions to prevent the app from switching your Windows theme during certain tasks, or have the app enable dark mode whenever your device is unplugged. The app also supports hotkeys for switching to themes and preventing themes from switching. |
@OwenCD This has been discussed earlier in this thread. Armin said that it was pretty much ready for integration: #1331 (comment) Then later when I asked for an update, Spiritreader mentioned that due to a Windows registry change, integrating ADM into powertoys would no longer be possible: #1331 (comment) Other solutions are discussed which you can read through after those comments, if you are interested. |
An option inside Power Toys that automatically switches between Windows 10's light and dark theme at a certain time of day, or at sunset and sunrise, similar to how Night Light does in Windows 10. Feature could also be configurable so that the user can choose to have the automated process switch only app theme, or both app and system theme.
The text was updated successfully, but these errors were encountered: