Skip to content

Instantly share code, notes, and snippets.

@jonasmalacofilho
Last active January 22, 2019 18:43
Show Gist options
  • Save jonasmalacofilho/f234fb3f925e5ee35d22b6717b3484ea to your computer and use it in GitHub Desktop.
Save jonasmalacofilho/f234fb3f925e5ee35d22b6717b3484ea to your computer and use it in GitHub Desktop.
Example: configure a liquidctl device on Windows
rem Configure a Kraken X62
rem
rem This batch script can be started manually or used in a Windows scheduled
rem task, for automatic configuration of the cooler during boot.
rem
rem Besides propagating error codes, uses the LEDs to convey progression and
rem eventual failures to the user in a visual way.
rem
rem Note that settings listed here are for reference only (if that), and assume
rem a very particular scenario:
rem
rem - Kraken X62 as top exhaust, tubes only do a continuous curve (no extra bends)
rem - NF-A14s in pull configuration
rem - peak CPU heat output of ~180W
rem - controlled ambient temperature of 25C
rem Make sure that Python and its packages are available in this context: if necessary,
rem add the relevant Python folders to the PATH environment variable; alternatively
rem for Anaconda, uncomment the following line
rem call %homepath%\Anaconda3\Scripts\activate.bat
rem Use VID/PID to filter the device we want; this way, if we add a new device,
rem or if a new version of liquidctl includes new drivers, our script remains stable
set KRAKEN=--vendor 0x1e71 --product 0x170e
rem Configure the cooler (1/3)
liquidctl %KRAKEN% set sync color off || goto :error
rem Configure the cooler (2/3)
liquidctl %KRAKEN% set fan speed 35 60 45 100 || goto :error
liquidctl %KRAKEN% set ring color super-fixed 000000 8C5A24 8C5A24 8C5A24 || goto :error
rem Configure the cooler (3/3)
liquidctl %KRAKEN% set pump speed 30 50 40 100 || goto :error
liquidctl %KRAKEN% set sync color fixed 8C5A24 || goto :error
rem To finalize wait a second and use a single color covering marquee for dramatic effect
timeout /t 1 /nobreak > NUL
liquidctl %KRAKEN% set ring color covering-marquee 8C5A24 || goto :error
goto :EOF
rem If a liquidctl invocation has failed we'll have jumped here; to communicate that
rem visually, we (try to) set the cooler to pulse red
:error
set code=%errorlevel%
liquidctl %KRAKEN% set ring color pulse ff2608 --speed faster
exit /b %code%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment