-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrightness.bat
More file actions
57 lines (45 loc) · 1.25 KB
/
Copy pathbrightness.bat
File metadata and controls
57 lines (45 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@ echo off
rem pushd C:\Program Files\Dell\Dell Display Manager 2
setlocal
echo You passed: %1
echo.
set color=Cool
if %1 == night (
echo Adjusting for night:
set brightness=25
set brightness_laptop=50
set contrast=50
) else (
if %1 == day (
echo Adjusting for day:
set brightness=50
set brightness_laptop=70
set contrast=75
) else (
echo Adjusting for middle:
set brightness=35
set brightness_laptop=55
set contrast=60
)
)
echo Setting %brightness%/%contrast% for monitors and %brightness_laptop% for laptop
echo.
rem Dell Monitors
start ddm /readbrightnesslevel ^
/readcontrastlevel ^
/writebrightnesslevel %brightness% ^
/writecontrastlevel %contrast% ^
/writecolorpreset %color% ^
/console start
rem Laptop
wmic /namespace:\\root\wmi ^
path WmiMonitorBrightnessMethods ^
where active=true ^
call WmiSetBrightness ^
Brightness=%brightness_laptop% ^
Timeout=0
rem Class: https://learn.microsoft.com/en-us/windows/win32/wmicoreprov/wmimonitorbrightnessmethods
rem Method: https://learn.microsoft.com/en-us/windows/win32/wmicoreprov/wmisetbrightness-method-in-class-wmimonitorbrightnessmethods
endlocal
rem popd
rem https://gist.github.com/nebriv/cb934a3b702346c5988f2aba5ee39f0d