Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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
    }


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: