#include #include #include #include #define LED_FILE "/sys/devices/platform/thinkpad_acpi/leds/tpacpi::lid_logo_dot/brightness" int main(void) { int fd_led; uint32_t r[1]; fd_led = open(LED_FILE, O_WRONLY); if (fd_led == -1) { write(2,"Can't open led control file.\n",29); return -1; } while(1) { usleep(50000); write(fd_led,"0",2); getrandom(r, sizeof(*r), GRND_NONBLOCK); usleep(*r&0x001fffff); write(fd_led,"255",4); } return 0; }