better explained code of darker mode as default with default done by typing "echo 1 > /tmp/AB.offset"
since this scrip is running as root on my machine, added chmod to edit AB.offset values as user.
if sensor is less than 3, sets to 1.
if xfce brightness bug puts actual_brightness to 0, it will goes to 1 with less than 3 in anbient or more with greater than 3 anbient..
add service in :"/etc/systemd/system/" to auto start and auto restart if broken in e.g. suspend. Works even in the greeter.