Open YoussefRaafatNasry opened 2 years ago
I'm interested in contributing this tool to the project and would be happy to champion development on it. I'm currently doing some exploratory looks into what APIs we'd use for this
I'm interested in contributing this tool to the project and would be happy to champion development on it. I'm currently doing some exploratory looks into what APIs we'd use for this
If you would like to contribute to PowerToys, we can discuss it here and you can start working on this :)
cc: @crutkas
Some initial thoughts, as I'm unfamiliar with what hooks Windows might have to achieve this:
1) Do we simply get the window borders and draw around them to create a dimming effect? Will this be performant enough on low-powered devices to create a good experience?
2) Alternatively, how does Windows handle drawing in terms of layering. Like, is there a z-index
equivalent on Windows that would let me draw n-1
overlay to create the effect?
3) It seems like this repo has split C# and CPP code - Does the PowerToys folks have preference one way or the other? I was leaning CPP, simply because FancyZones seems to be using it, and I suspect some codesharing might be able to occur there EDIT: Apologies, it seems to be pretty clearly in favor of CPP per the style guide
Something I wanna test: I want to make sure multi-monitor support is handled OOTB - since this is a big part of the feature for me
Some initial thoughts, as I'm unfamiliar with what hooks Windows might have to achieve this:
- Do we simply get the window borders and draw around them to create a dimming effect? Will this be performant enough on low-powered devices to create a good experience?
- Alternatively, how does Windows handle drawing in terms of layering. Like, is there a
z-index
equivalent on Windows that would let me drawn-1
overlay to create the effect?- ~It seems like this repo has split C# and CPP code - Does the PowerToys folks have preference one way or the other? I was leaning CPP, simply because FancyZones seems to be using it, and I suspect some codesharing might be able to occur there~ EDIT: Apologies, it seems to be pretty clearly in favor of CPP per the style guide
Something I wanna test: I want to make sure multi-monitor support is handled OOTB - since this is a big part of the feature for me
@crutchcorn I saw you started working on this. I will add the in progress label for you, if this is ok.
This is actually #9496
but lets move that here as this has more info.
I would suggest creating a POC that is outside powertoys itself so we can test that directly. From there we can talk about implementation back in. Trust me on so many levels this will be easier :)
Pick either C++ or C#
So there are some questions which need clarification:
cc: @dedavis6797 @crutkas
Here is what i'm thinking: @crutchcorn what are your thoughts?
Sounds good. I'll try to make it with C# and just do some experimentation. I tried to start with a PowerToys instance, and couldn't even get main
or stable
building on my end after 3hrs of attempts (I'm not great w/ C# or CPP Windows build tooling, so that's prob on me) so this works out well
Yeah, that makes sense. Ideally, we also have the ability to toggle it on/off from a tray icon as well - although I don't know any other PowerToy that does this
I don't agree about the underlay dismissing it or alt-tab dismissing it entirely, however (at least not without settings).
For example, I do technical content writing and use HazeOver on my laptop to help me focus on writing when I need it. However, I also want to focus on research and quickly switch between the two. It helps a fair bit with my ADHD when I need to go full heads down mode but still need to multitask.
Disabling game mode makes sense to me - although I think that will be a post-POC feature.
PowerToys itself is a hub and spoke model, every feature is actually a different item and everything reports back to runner / settings but even then, everything is designed to be self contained.
I think once we have something to play with, we can make some further design choices like you said. Some of these were guessing how i may want it to work.
Part of me thinks maybe the alt-tab we may want as a setting but yeah, lets test out a POC like we have with Always on top and the find my mouse recently to see what may need to be refined to hit minimal lovable :)
@crutchcorn how is it going! would love to see what insanity you whipped up
Wanted to see this happen so I wrote PowerDimmer, a first attempt.
Be nice as I know next to nothing about developing .NET/Win32/etc... Got it working and using it, though! 😄
@shayne is it possible this repo is private? It 404s for me
@crutkas I admittedly haven't yet given it a stab. I was planning on doing so this week, but it seems like @shayne possibly has a strong start. I'm hoping I can help a bit when I can take a look at it :)
Woops! Yeah, public now.
I will take a look tomorrow!
It works well! (although does have a bug or two I noticed - but the core is definitely there!)
@shayne - is it okay if I submit bug reports and/or PRs to the GH repo? Or would you like me to hold off for now until @crutkas has a chance to look through the code?
Feel free to file the bug in case it's not on my radar. There are a few known issues. I figured I should release it as is since (when you're not trying to break it) it works well. Perhaps some Windows experts can spot the issues instead of me spinning my wheels :)
@shayne - Looking good so far! I didn't know LeDimmer existed and I was playing around with PowerToys today and thought it would be nice to have a focus app like this. Hopeful to see this make it into PowerToys soon!
Just wanted to leave confirmation that @shayne's work works extremely well - even for weird multi-monitor and multi-DPI setups like @happiness801 and mine! Thanks again for building it @shayne - it's deeply appreciated
Tried, this is neat. I think one thing i would want is to quickly toggle on / off entire feature without exiting it.
@shayne, you're thought is to maybe have put this in powertoys? correct? With the item above, this is at what i'd classify as lovable.
i would want is to quickly toggle on / off entire feature without exiting it
Added this as well as an "Active on launch?" setting.
I think there are two settings.
This IMO would be a good reference for this. At times i need the overlay, others i don't. Some people may want it just fully off.
@crutkas the activation shortcut is in place. I agree with the "fully off" feature like others in PT. It would make sense to add that feature when integrating my project into PT. Right now it exists as a standalone app.
To answer your previous question, yes I would like to see this in PT. It is a lot less effort to develop and test it standalone. I was waiting for feedback and general support before working on PT integration.
Is anybody working on this?
@crutchcorn Do you need any help from us?
Wanted to see this happen so I wrote PowerDimmer, a first attempt.
Be nice as I know next to nothing about developing .NET/Win32/etc... Got it working and using it, though! 😄
Thanks for this! It's exactly what I was looking for: simple and elegant. Great job!
@shayne on multiple launches, it fails to run, i like it however.
Both livable
@crutkas curious about the launch failures. I do know it doesn't handle conflicting global keybinds gracefully.
I do use it daily, however I find with Windows 11 I have to restart it to get it to properly layer. It's like the "dim windows" stop ordering correctly.
Any direction would be greatly appreciated.
@shayne it crashes on 2nd launch for me on
settings = new ConfigurationBuilder<ISettings>().UseJsonFile("settings.json").Build();
settings.DimmingEnabled = settings.ActiveOnLaunch;
System.IO.IOException: 'Unable to move the replacement file to the file to be replaced. The file to be replaced has retained its original name.'
@shayne nice job 😃
I gave it a try and I am also experiencing System.IO.IOException: 'Unable to move the replacement file to the file to be replaced. The file to be replaced has retained its original name.'
on 2nd launch that looks related to Config.Net
nuget package.
On first launch I am randomly experiencing An unhandled exception of type 'System.ExecutionEngineException' occurred in WindowsBase.dll
after a few minutes of usage. I have been able to fix the crash converting the Win32.WinEventDelegate
to a field.
https://github.com/shayne/PowerDimmer/blob/5f1b63ecc359f911159f364e6a8c7211decbe52b/App.xaml.cs#L84
Reference: https://stackoverflow.com/a/56774612
How is this feature coming along? I noticed @shayne's PowerDimmer repo is a couple years without any improvements, so I assume it is still a PoC?
I use it daily and works for me. Unfortunately, I don't have the bandwidth to bring it into PowerToys.
One more vote for this! Absolutely needed for focused work.
would love to see this as well
These guys just release "Crop & Lock" in v0.73. Interesting feature, but really doesn't help much with focus...
...if you are interested, I found CinemaDrape actually does what we need (or something very close to it).
I'm seeing a lot of 'dim screen' feature requests being duped and referred here, so rather than create a new feature request, I'd like to request an extension of the feature described in this thread please.
Sometimes I find that my screen is just way too bright in some dark situations. I don't want to or cannot turn on another light source to counter-balance the situation, so instead I try to dim my screen, but my graphics driver or Windows will only dim it so far. Pitifully so. Dark Mode at the OS or application level is not a solution either - I find its support is patchy. So instead I use colour inversion in dark settings, in Ease of Access > Colour filters. This is good for me, but even then some elements of the screen (text, UI) can be too bright as to be piercing my eyeballs. My device has a pretty good screen, not gonna lie.
So I'm looking for a Super Dim or Ultra Dim app, and I'm hoping it can graduate to the suite of PowerToys.
I imagine it's just a black layer with an opacity setting (I work with CSS, so that's where my thinking comes from). A dark translucent filter layer that covers the entire screen at the touch of a key combo.
I'd also like the option for this filter to be a light (as in white) filter too (remember I talked about colour inversion).
Loving your work with PowerToys, thank you.
Hello! The dimming feature is super helpful for me especially with the OLED Display of my laptop. Right now, I am using the LeDimmer because the PowerDimmer does not work on my system and in my opinion, adding this feature in PowerToys is a very great idea. I have been using PowerToys for years and it helped me in being productive. Looking forward in new features PowerToys!
Since ticket still opened: PowerDimmer mentioned already works perfectly fine for me on Win11 if one bothers their repo being not too active.
Since ticket still opened: PowerDimmer mentioned already works perfectly fine for me on Win11 if one bothers their repo being not too active.
For me it crashed silently a lot, this fork is working pretty much perfectly, but you have to build it yourself
UPD: updated url to specific branch
If they send me a PR I'd be happy to merge it. 🤷♂️
If they send me a PR I'd be happy to merge it. 🤷♂️
Author of those fork isn't active for two years, i'm pretty sure that it's completely forgotten
Someone reached out to me about my PowerDimmer fork... Yep, I totally forgot about it! I just opened a PR that fixes the silent crashes and added dimming/shades to windows and selected areas of windows.
Description of the new feature / enhancement
A tool like HazeOver to dim inactive windows, to help reduce distraction and increase focus.
Scenario when this would be used?
Supporting information
I found a windows alternative called LeDimmer, but it's abandoned and not open-source. It also lacks a lot of options.