mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2025-12-28 09:47:50 -05:00
29 lines
1.1 KiB
C++
29 lines
1.1 KiB
C++
#include "RGBController_AsusTUFLaptopLinux.h"
|
|
#include "AsusTUFLaptopLinuxController.h"
|
|
|
|
#include <string>
|
|
#include "Detector.h"
|
|
#include <unistd.h>
|
|
|
|
static void DetectAsusTUFLaptopLinuxControllers()
|
|
{
|
|
/*-------------------------------------------------------------------------------------*\
|
|
| If /sys/devices/platform/asus-nb-wmi/leds/asus::kbd_backlight/kbd_rgb_mode exists, |
|
|
| the kernel support TUF Laptop keyboard LED controlling. |
|
|
\*-------------------------------------------------------------------------------------*/
|
|
|
|
std::string s = "";
|
|
s.append(ASUS_KBD_BACKLIGHT_BASE_PATH);
|
|
s.append(ASUS_KBD_BACKLIGHT_MODE_PATH);
|
|
|
|
if(!access(s.c_str(), F_OK))
|
|
{
|
|
AsusTUFLaptopLinuxController* controller = new AsusTUFLaptopLinuxController();
|
|
RGBController_AsusTUFLaptopLinux* rgb_controller = new RGBController_AsusTUFLaptopLinux(controller);
|
|
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
|
}
|
|
return;
|
|
}
|
|
|
|
REGISTER_DETECTOR("ASUS TUF Laptop Linux WMI", DetectAsusTUFLaptopLinuxControllers);
|