Skip to content

Instantly share code, notes, and snippets.

@jm33-m0
Last active October 27, 2022 03:05
Show Gist options
  • Save jm33-m0/e9a1067c24b53b6006d5d65ae0c9a5c3 to your computer and use it in GitHub Desktop.
Save jm33-m0/e9a1067c24b53b6006d5d65ae0c9a5c3 to your computer and use it in GitHub Desktop.
Toggle Asus ROG G14/15 LED Matrix
@echo off
:: Check privileges
net file 1>NUL 2>NUL
if not '%errorlevel%' == '0' (
powershell Start-Process -FilePath "%0" -ArgumentList "%cd%" -verb runas >NUL 2>&1
exit /b
)
:: Change directory with passed argument. Processes started with
:: "runas" start with forced C:\Windows\System32 workdir
cd /d %1
:: Actual work
cd %~dp0
:: cd to LightingService directory
cd "C:\Program Files (x86)\LightingService\script"
if exist anime-off (
del anime-off
copy LedMatrix_LastScript.xml.default LedMatrix_LastScript.xml
echo Replacing profile with default anime...
powershell -command "Restart-Service LightingService -Force"
) else (
copy LedMatrix_LastScript.xml.empty LedMatrix_LastScript.xml
:: Replace profile with empty anime
echo Replacing profile with empty anime...
:: Restart LightingService to apply
powershell -command "Restart-Service LightingService -Force"
echo LED Matrix stopped >anime-off
echo LedMatrix stopped.
)
pause
@jm33-m0
Copy link
Author

jm33-m0 commented Oct 26, 2022

Files are located in C:\Program Files (x86)\LightingService\script, which requires ArmoryCrate to be installed.

But you can disable all ArmoryCrate services and use this script to turn on/off anime matrix. Read the XML to understand how you can customize your anime matrix.

@jm33-m0
Copy link
Author

jm33-m0 commented Oct 26, 2022

An empty anime config XML:

<root>
    <header>AURA_3.0</header>
    <version>1.0</version>
    <effectProvider>
        <period>-1</period>
        <queue>
            <effect key="anime_GA401IV_0">
                <viewport>GA401IV_0</viewport>
                <trigger>OneTime</trigger>
                <delay>0</delay>
                <duration>-1</duration>
                <layer>0</layer>
            </effect>
        </queue>
    </effectProvider>
    <viewport>
        <group key="GA401IV_0">
            <device>
                <matrix_w>68</matrix_w>
                <matrix_h>28</matrix_h>
                <slash_h>36</slash_h>
                <model>GA401IV</model>
                <type>MATRIX_Laptop</type>
                <direction>0</direction>
                <rgb>0</rgb>
                <index>0</index>
                <location>
                    <x>0</x>
                    <y>0</y>
                </location>
                <usage>
                    <led key="-1" />
                </usage>
            </device>
        </group>
    </viewport>
    <effectList></effectList>
</root>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment