Windows Night Light aktivieren / deaktivieren

  • VB.NET
  • .NET (FX) 4.5–4.8

Es gibt 5 Antworten in diesem Thema. Der letzte Beitrag () ist von Michdi.

    Windows Night Light aktivieren / deaktivieren

    Guten Abend,
    ich will mir eine Applikation bauen, die um beispielsweise 20 Uhr den Nachtmodus aktiviert, die Trigger sind aber erst einmal egal, die kann man ja später noch verändern. Diese würde ich in den Autostart packen.
    Nun meine Frage: Wie kann man den Nightlight-Modus von Windows 10 im Creators Update aktivieren? Diese automatische Variante ist zwar ganz nett, funktioniert bei mir aber nur mäßig (geht nicht wieder aus, schaltet sich immer sehr spät erst ein, z.B. jetzt noch nicht aktiv)

    Danke schon Mal,

    Michdi
    Die beste maschinelle Übersetzung der Welt - DeepL Übersetzer
    Alle Zitate, die ich seit dem 1.9.2017 übersetzt habe, wurden vollautomatisch mit DeepL übersetzt.



    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Michdi“ ()

    Sollte man das nicht auch in den Einstellungen direkt aktivieren können?

    Click the “Turn On Now” or “Turn Off Now” button to immediately enable or disable the Night Light feature, no matter what time of day it is. You can use this button to see exactly what Night Light mode looks like without waiting for sunset.


    Quelle: https://www.howtogeek.com/302186/how-to-enable-night-light-on-windows-10/

    PS: Kann auch sein das ich daneben liege, hab das Update noch nicht geholt - weil da noch einige Fehler sind.
    Das ist ein Feature, der neu ist, denke nicht, dass schon dafür einen Leitfaden dafür gibt (habe zumindest keins gefunden). Also vermutte man muss warten bis die MVPs was raushauen oder selber forschen, was ich nicht empfehlen würde.

    Hier einer mit der selben Problematik: Link
    Vermutte mittels PowerShell und/oder Registry kann man das alles bewältigen, aber man muss erstmal wissen was zu tun ist...

    Hatte auch mich das gefragt und mehrere ähnliche Fragen bei StackOverflow gefunden (damals noch alle unbeantwortet).

    Nur zur Info: Bei mir geht es reibungslos die ganze Gesichte vom DarkMode und NightLight....


    Life doesn't give you a datasheet. Sometimes the docs are wrong and you have to try it.
    Also ich weiss nicht ob man in der registry, einfach Binärdaten ändern kann, aber unter dem Key:

    Spoiler anzeigen
    Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount\$$windows.data.bluelightreduction.bluelightreductionstate\Current

    Quelle :


    verändert sich der Inhalt der "Data" Binary

    ist nightmode deaktiviert sieht der Inhalt aus wie im Bild nmoff, schalte ich diesen ein, sieht es aus wie im Bild nmon

    ich hoffe das bringt dich etwas weiter

    Greets

    P.S. Credits, die wunderschönen Fotos sind aus meiner Registry und haben aktuell keinen laufenden Modelvertrag xD
    Bilder
    • nmoff.JPG

      112,04 kB, 1.016×662, 300 mal angesehen
    • nmon.JPG

      107,23 kB, 1.011×654, 301 mal angesehen
    If Energy = Low Then
    Drink(aHugeCoffee)
    Else
    Drink(aHugeCoffeeToo)
    End If
    Ich habe folgendes Powershell-Skript gefunden durch @asusdk:

    Brainfuck-Quellcode

    1. <#PSScriptInfo
    2. .VERSION 1.0.0
    3. .GUID 3002727e-d221-4da0-960c-26a415fb2fce
    4. .AUTHOR Jaap Brasser
    5. .COMPANYNAME
    6. .COPYRIGHT
    7. .TAGS
    8. .LICENSEURI
    9. .PROJECTURI
    10. .ICONURI
    11. .EXTERNALMODULEDEPENDENCIES
    12. .REQUIREDSCRIPTS
    13. .EXTERNALSCRIPTDEPENDENCIES
    14. .RELEASENOTES
    15. .DESCRIPTION
    16. This function can configure the Blue light options on a Windows 10 system.
    17. #>
    18. function Set-BlueLight {
    19. <#
    20. .SYNOPSIS
    21. Configures the Blue light options on Windows 10
    22. .DESCRIPTION
    23. This function can configure the Blue light options on a Windows 10 system.
    24. .PARAMETER DisableBlueLight
    25. Disables blue light setting, restoring the colors to regular colors
    26. .PARAMETER EnableBlueLight
    27. Enables blue light setting, lowering blue light emitted
    28. .PARAMETER DisableAutomaticSchedule
    29. Disables automatic day-night schedule based on geographical location
    30. .PARAMETER EnableAutomaticSchedule
    31. Enables automatic day-night schedule based on geographical location
    32. .PARAMETER ColorTemperature
    33. Defines the color temperature of the blue light settings
    34. .NOTES
    35. Name: Set-BlueLight
    36. Author: Jaap Brasser
    37. DateCreated: 2017-01-13
    38. DateUpdated: 2017-01-13
    39. Version: 1.0.0
    40. Blog: http://www.jaapbrasser.com
    41. .LINK
    42. http://www.jaapbrasser.com
    43. .EXAMPLE
    44. Set-BlueLight -DisableBlueLight
    45. Description
    46. -----------
    47. Disables reduced blue light and restores colors to default
    48. .EXAMPLE
    49. Set-BlueLight -EnableBlueLight -ColorTemperature MediumShift
    50. Description
    51. -----------
    52. Enables reduced blue light and sets colors to the half way point on the color temperature slider
    53. .EXAMPLE
    54. Set-BlueLight -EnableAutomaticSchedule
    55. Description
    56. -----------
    57. Enables automatic day-night schedule based on geographical location
    58. #>
    59. [cmdletbinding(SupportsShouldProcess=$true)]
    60. param(
    61. [Parameter(
    62. Mandatory=$true,
    63. ParameterSetName='BlueShift Off'
    64. )]
    65. [switch] $DisableBlueLight,
    66. [Parameter(
    67. Mandatory=$true,
    68. ParameterSetName='BlueShift On'
    69. )]
    70. [switch] $EnableBlueLight,
    71. [Parameter(
    72. Mandatory=$true,
    73. ParameterSetName='Automatic Off'
    74. )]
    75. [switch] $DisableAutomaticSchedule,
    76. [Parameter(
    77. Mandatory=$true,
    78. ParameterSetName='Automatic On'
    79. )]
    80. [switch] $EnableAutomaticSchedule,
    81. [Parameter(
    82. Mandatory=$false,
    83. ParameterSetName='BlueShift On'
    84. )]
    85. [Parameter(
    86. Mandatory=$false,
    87. ParameterSetName='BlueShift Off'
    88. )]
    89. [Parameter(
    90. Mandatory=$false,
    91. ParameterSetName='Automatic On'
    92. )]
    93. [Parameter(
    94. Mandatory=$false,
    95. ParameterSetName='Automatic Off'
    96. )]
    97. [Parameter(
    98. Mandatory=$true,
    99. ParameterSetName='Color Temperature'
    100. )]
    101. [ValidateSet('NoShift', 'MinimumShift', 'MediumShift', 'LargeShift', 'MaximumShift')]
    102. [string] $ColorTemperature
    103. )
    104. begin {
    105. $BlueLightOption = @{
    106. Off = [byte[]](2,0,0,0,147,250,216,91,185,109,210,1,0,0,0,0,67,66,1,0,208,10,2,198,20,202,236,227,222,149,183,155,233,1,0)
    107. On = [byte[]](2,0,0,0,128,208,150,171,186,109,210,1,0,0,0,0,67,66,1,0,16,0,208,10,2,198,20,221,137,219,220,170,183,155,233,1,0)
    108. AutoOn = [byte[]](2,0,0,0,89,63,239,213,232,109,210,1,0,0,0,0,67,66,1,0,2,1,202,20,14,21,0,202,30,14,7,0,207,40,188,62,202,50,14,16,46,54,0,202,60,14,8,46,46,0,0)
    109. AutoOff = [byte[]](2,0,0,0,175,164,252,55,235,109,210,1,0,0,0,0,67,66,1,0,202,20,14,21,0,202,30,14,7,0,207,40,188,62,202,50,14,16,46,54,0,202,60,14,8,46,46,0,0)
    110. NoShift = [byte[]](2,0,0,0,255,124,43,3,82,107,210,1,0,0,0,0,67,66,1,0,2,1,202,20,14,21,0,202,30,14,7,0,207,40,168,70,202,50,14,16,46,49,0,202,60,14,8,46,47,0,0)
    111. MinimumShift = [byte[]](2,0,0,0,224,193,179,114,82,107,210,1,0,0,0,0,67,66,1,0,2,1,202,20,14,21,0,202,30,14,7,0,207,40,236,57,202,50,14,16,46,49,0,202,60,14,8,46,47,0,0)
    112. MediumShift = [byte[]](2,0,0,0,49,229,185,33,82,107,210,1,0,0,0,0,67,66,1,0,2,1,202,20,14,21,0,202,30,14,7,0,207,40,200,42,202,50,14,16,46,49,0,202,60,14,8,46,47,0,0)
    113. LargeShift = [byte[]](2,0,0,0,22,255,5,128,82,107,210,1,0,0,0,0,67,66,1,0,2,1,202,20,14,21,0,202,30,14,7,0,207,40,138,27,202,50,14,16,46,49,0,202,60,14,8,46,47,0,0)
    114. MaximumShift = [byte[]](2,0,0,0,199,91,231,198,81,107,210,1,0,0,0,0,67,66,1,0,2,1,202,20,14,21,0,202,30,14,7,0,207,40,208,15,202,50,14,16,46,49,0,202,60,14,8,46,47,0,0)
    115. }
    116. $SetRegistrySplat = @{
    117. Path = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount\{0}\Current'
    118. Force = $true
    119. Name = 'Data'
    120. }
    121. function Set-RegistryValue {
    122. if (-not (Test-Path -Path $SetRegistrySplat.Path)) {
    123. if ($PSCmdlet.ShouldProcess($SetRegistrySplat.Path,'Creating registry key')) {
    124. $null = New-Item -Path $SetRegistrySplat.Path -Force
    125. }
    126. }
    127. if ($PSCmdlet.ShouldProcess($SetRegistrySplat.Path,'Updating registry value')) {
    128. $null = Set-ItemProperty @SetRegistrySplat
    129. }
    130. }
    131. }
    132. process {
    133. switch ($PsCmdlet.ParameterSetName) {
    134. 'BlueShift Off' {
    135. $SetRegistrySplat.Path = $SetRegistrySplat.Path -f '$$windows.data.bluelightreduction.bluelightreductionstate'
    136. $SetRegistrySplat.Value = $BlueLightOption.Off
    137. Set-RegistryValue
    138. }
    139. 'BlueShift On' {
    140. $SetRegistrySplat.Path = $SetRegistrySplat.Path -f '$$windows.data.bluelightreduction.bluelightreductionstate'
    141. $SetRegistrySplat.Value = $BlueLightOption.On
    142. Set-RegistryValue
    143. }
    144. 'Automatic Off' {
    145. $SetRegistrySplat.Path = $SetRegistrySplat.Path -f '$$windows.data.bluelightreduction.settings'
    146. $SetRegistrySplat.Value = $BlueLightOption.AutoOff
    147. Set-RegistryValue
    148. }
    149. 'Automatic On' {
    150. $SetRegistrySplat.Path = $SetRegistrySplat.Path -f '$$windows.data.bluelightreduction.settings'
    151. $SetRegistrySplat.Value = $BlueLightOption.AutoOn
    152. Set-RegistryValue
    153. }
    154. {$ColorTemperature} {
    155. $SetRegistrySplat.Path = $SetRegistrySplat.Path -f '$$windows.data.bluelightreduction.settings'
    156. $SetRegistrySplat.Value = $BlueLightOption.$ColorTemperature
    157. Set-RegistryValue
    158. }
    159. }
    160. }
    161. }
    Die beste maschinelle Übersetzung der Welt - DeepL Übersetzer
    Alle Zitate, die ich seit dem 1.9.2017 übersetzt habe, wurden vollautomatisch mit DeepL übersetzt.