Skip to content

About

A tiny utility for controlling the ThinkLight on ThinkPad laptops in Haiku OS

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

thinklight

A tiny utility for controlling the ThinkLight on ThinkPad laptops in Haiku OS.

It talks to the ACPI firmware through the /dev/acpi/call device of Haiku, so no driver is needed.

Usage

thinklight 1               light on
thinklight 0               light off
thinklight -64_12-8        blink a pattern

A pattern is a sequence of segments: -N keeps the light on for N ticks, _N keeps it off for N ticks. One tick is 1/16 of a second, so the example above is on for 4 s, off for 0.75 s, on for 0.5 s, off for 1/16 s. The pattern is played once and the light is turned off afterwards. Ctrl+C during a pattern turns the light off and exits.

Build

g++ -Wno-multichar -O2 -o thinklight thinklight.cpp

Notes

  • Tested on a ThinkPad T60 (x86_gcc2 and x86_64 Haiku). Other models with a ThinkLight may work, since the same CMOS commands are used by other ThinkPad drivers, but this is not verified.
  • The light is switched with the ACPI method \UCMS (commands 0x0C and 0x0D). On a machine without this method the kernel still reports success, so the program silently does nothing.
  • The ioctl interface of /dev/acpi/call is not part of the public Haiku headers. The structures are copied from the Haiku source (src/add-ons/kernel/bus_managers/acpi/Call.cpp) and may change in a future release.

License

MIT, see LICENSE.

About

A tiny utility for controlling the ThinkLight on ThinkPad laptops in Haiku OS

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages