Author image Ævar Arnfjörð Bjarmason


Linux::Apple::Laptop::LED - Turn the front LED on Apple laptops on and off via ADB


    use IO::Handle ();
    use Time::HiRes qw(usleep);
    use Linux::Apple::Laptop::LED qw(ON OFF);

    open my $fh, ">", "/dev/adb" or die $!;

    my $nap = 100_000; # 0.1 seconds
    for (1 .. 10) {
        syswrite($fh => ON);
        usleep($nap / 2);
        syswrite($fh => OFF);
        usleep($nap / 2);


Provides an interface for turning the front LED on Apple laptops running Linux on and off. The user needs to open /dev/adb and print either ON or OFF to it to turn the led on and off, respectively.


Can optionally export two constant subroutines, ON ond OFF, which return a string to be written to /dev/adb.


Ævar Arnfjörð Bjarmason <>


Copyright 2007 Ævar Arnfjörð Bjarmason.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.