Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions stable/ChangeDesktopDisplayBrightness.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# WARN Requires hardware the supports DDC/CI (the ability to change display brightness in Windows)

param (
[Parameter(Mandatory=$true)][int]$daySegment2, # 0 = Day, 1 = Night
[Parameter(Mandatory=$true)][int]$daySegment4, # -1 = N/A, 0 = Sunrise, 1 = Day, 2 = Sunset, 3 = Night
[Parameter(Mandatory=$true)][bool]$nightMode, # True if night mode is enabled
[Parameter(Mandatory=$false)][string]$imagePath # Path to current wallpaper image
)

# Edit these values to be a valid screen brightness percent between 0 and 100
$sunriseBrightness = 40
$dayBrightness = 50
$sunsetBrightness = 30
$nightBrightness = 20

if ( $daySegment4 -eq -1 ) {
$daySegment4 = $daySegment2 * 2 + 1
}

$brightnessPercent = switch ( $daySegment4 )
{
0 { $sunriseBrightness }
1 { $dayBrightness }
2 { $sunsetBrightness }
3 { $nightBrightness }
}

.\ddccli.exe -b $brightnessPercent
Binary file added stable/ddccli.exe
Binary file not shown.