mlaily / NegativeScreen

NegativeScreen is a Windows application allowing you to invert your screen colors. (and more)
https://zerowidthjoiner.net/negativescreen
GNU General Public License v3.0
171 stars 21 forks source link

Reload of config file? #19

Open HelenFoster opened 5 years ago

HelenFoster commented 5 years ago

Hi, many thanks for this useful software!

I've been working on some colour matrices for NegativeScreen. ColorMatrix Viewer can be used to give immediate feedback on the result of changing a number; but in NegativeScreen it's useful to have the effect applied to the whole desktop environment while working on it.

I set up a script to exit and reload NegativeScreen when the config file changes. This almost works, but the colour effect switches off during the time between exit and reload. When working on a dark theme, this means flashing a light in your eye, and prevents comparison between old and new.

So I was thinking it would be really useful if NegativeScreen could reload the config file itself, without any gaps. With a keyboard shortcut, an API command, and possibly an internal option to watch the config file for changes.

HelenFoster commented 5 years ago

Here's my current PowerShell script, based on https://superuser.com/a/844034

$watcher = New-Object System.IO.FileSystemWatcher
$watcher.Path = "C:\NegativeScreen"
$watcher.Filter = "negativescreen.conf"
$watcher.IncludeSubdirectories = $false
$watcher.EnableRaisingEvents = $true  

$action = {
    stop-process -name NegativeScreen -force
    Invoke-Item C:\NegativeScreen\NegativeScreen.exe
}

Register-ObjectEvent $watcher "Changed" -Action $action
while ($true) {sleep 0.5}
mlaily commented 5 years ago

Mmh, this seems like a lot of work to support an edge case.

There is a reason why creating new color effects is not built into NegativeScreen: if you input a wrong matrix, your screen may go blank, and unless you know the shortcut to exit the application, you may get stuck there.

ColorMatrix Viewer is supposed to be the way to go when editing color matrices. I'm curious what you are missing in it that you have with your method?

HelenFoster commented 5 years ago

OK, makes sense that creating effects is out of scope. I also didn't notice https://github.com/mlaily/ColorMatrixViewer/issues/1#issuecomment-372093640 before posting.

I was having some difficulty mentally translating the results from ColorMatrix Viewer to what it would look like when applied to everything. I'll think about why, and create issue(s) over there if I come up with any concrete proposals.