adrianmteo / Luna

Automatic dark mode for Windows 10
MIT License
280 stars 12 forks source link

Integrate Luna into Microsoft PowerToys as a PowerToy? #17

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi!

I love automatic theme switching that open source solutions offer in general, and Luna in particular.

I also love Microsoft PowerToys and remembered a feature request that looks like something that the Luna project could contribute to. It's this issue: https://github.com/microsoft/PowerToys/issues/1331 .

My suggestion is to integrate Luna into PowerToys as a separate PowerToy. I believe both the project and the user would benefit from this. The project would probably gain more traction, support, feedback etc. And I think the user would benefit from the ease of using PowerToys, having one less installation on their PC and the discoverability of the project.

What do you think?

adrianmteo commented 4 years ago

@irafaz This is a great idea! I will take a look and see what I can do 😄

Update: At a first glance at their repo there are some concerns:

ghost commented 4 years ago

@adrianmteo ouch, didn't even look into that.

Hopefully a potential Power Toy could force Microsoft to develop public APIs for such tasks? That would also benefit all of us, I assume?

I'll happily keep using Luna as it is until Microsoft develops something either for PowerToys or for Windows 10 😊

niels9001 commented 4 years ago

@adrianmteo

Some modules of PowerToys are in C#, so C++ doesn't need to be there. Additionally, I think Luna would live in the PowerToys settings menu which is using WPF (and UWP with XAML Island) so porting this over should be straight-forward!

Public APIs is an issue - @crutkas could you comment on this?

adrianmteo commented 4 years ago

This will not be implemented. Closing this ticket.

crutkas commented 4 years ago

PowerToys won't use private Windows APIs. if something needs to be public, we can work together to create a wrapper DLL so calls are done in a way that is appropriate.

adrianmteo commented 4 years ago

Luna uses private API calls, PowerToys not. The decision is purely because I want the app to be independent and have the flexibility as a developer to take it in which direction I want.

crutkas commented 4 years ago

Totally understandable

How about we discuss what said APIs you are using that are undocumented APIs :)

There may be public ones that do the same or lets start the long road of making them public / a public api around them.

Crutkas@microsoft.com

adrianmteo commented 4 years ago

@crutkas I like your interest of making Microsoft products better 😃

Besides TaskScheduler and Registry, I use an internal .exe used by Windows Aero developers (here) that changes the Windows theme based on a .theme file. From what I've seen it's not possible without having the Windows API itself modified (or at least from what I've read). Settings + Control Panel have this ability.

Secondly I use DLLImport here but I don't think that those are private API calls since they are documented.

Lastly I want to work on changing other apps to dark mode automatically, like Microsoft Office, maybe Visual Studio. Office seemed like a simple Registry edit but the theme is not persisted.