This project is no longer under active development. I no longer own suitable hardware. This repo is archived and read-only.
- UX305FA
- Linux 4.4.1
- Linux 4.4.2
- Linux 4.4.3
- Linux 4.4.5
Required packages: libbsd-dev, qt4-qmake / qt5-qmake, g++
- Install the ALS Driver:
- Download the source code from here.
- Extract the archive, move into the directory, and compile with
make
. - Insert the module into your current kernel with
sudo insmod als.ko
- Build this controller:
cd service
qmake als-controller.pro -r -spec linux-g++-64
, orqmake als-controller.pro -r -spec linux-g++
if you're on a 32-bit system.make
The generated binary file, als-controller, is what will monitor the light sensor.
-
Launch als-controller with root privileges, for example:
sudo ./als-controller
. This will be the service that monitors the light sensor. -
Use the same program with user privileges, als-controller, to control the service. Some examples:
./als-controller -e // Enable the sensor ./als-controller -d // Disable the sensor ./als-controller -s // Get sensor status (enabled/disabled)
After compiling and running als-controller, try running switch.sh from the "example" folder. For an ideal integration with your system, the suggested idea is to start the service at boot, and then bind some script similar to switch.sh to a key combination on your keyboard.
It looks like acpi_als is shadowing the als module. If you explicitly load als and blacklist acpi_als it should work.
echo "als" > /etc/modules-load.d/als
echo "blacklist acpi_als" > /etc/modprobe.d/als.conf
If als-controller still isn't working, a possible cause is that the driver can't see the sensor. Try setting the boot option acpi_osi='!Windows 2012'
(e.g. at the end of GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub) and then reboot.
- Diego - https://github.com/Voskot
- danields - https://github.com/danieleds