Auto Dark Mode for Windows

(github.com)

12 points | by hermitsings 3 days ago ago

11 comments

  • mmwelt 2 days ago

    A very similar function was just added to Microsoft PowerToys 0.95 recently, called Light Switch[1]. It doesn't have all the bells and whistles, but basically does the same task, including switching modes automatically based on sunrise and sunset times.

    [1] https://learn.microsoft.com/en-us/windows/powertoys/light-sw...

  • mrkramer 2 days ago

    I had similar idea of changing my PC's brightness according to the time of the day. It probably could've been implemented pretty easily using Windows API and some little hacking.

  • gabrielsroka 2 days ago

    Years ago, I wrote a very stripped-down version in a few lines of PowerShell. I'll upload it when I get home.

    • gabrielsroka a day ago

      my minimal powershell code

          $old = -1
          while ($true) {
              $d = Get-Date
              $hour = $d.Hour
              if ($hour -ge 6 -and $hour -lt 19) {
                  $light = 1
              } else {
                  $light = 0
              }
              if ($old -ne $light) {
                  Set-ItemProperty HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize AppsUseLightTheme $light
                  $old = $light
                  echo $light $d
              }
              sleep -Seconds 2
          }
    • lostmsu 2 days ago

      I did the same just a few days ago based on webcam, 26 lines of PowerShell.

      See https://gist.github.com/lostmsu/cde4a8578d8e0ea1182f579f44bd...

  • lousken 2 days ago

    It's honestly surprising that it took this long even on KDE. I was switching themes automatically for years with a preference setting in f.lux. Every app on system preference, dark reader as well.

  • BoredPositron a day ago

    Does it really matter if 60% of system dialogs are still a flash bang?

    • xaxaxb a day ago

      Are you on Windows 11?

      • BoredPositron a day ago

        They fixed the copy dialogs now but it's still not a full dark mode.

        • a day ago
          [deleted]