Open WhyNotHugo opened 9 years ago
I found a bug in the way the get_screensaver_active function handles the dbus messages. It works for me. Please try my repository at https://github.com/esoleyman/lightum. I've included the patches from PR #44 there as well.
Running https://github.com/esoleyman/lightum:
$ lightum -fvd 1 -w 1 -s -i 5
CONFIG:
manualmode: 0
ignoreuser: 1
ignoresession: 0
workmode: 1
queryscreensaver: 1
maxbrightness: 255
minbrightness: 0
maxbacklight: 15
minbacklight: 1
polltime: 300
idleoff: 5
screenidle: 30
fulldim: 0
lightum v2.3.1 running in auto mode
** (lightum:6408): WARNING **: variant return type is unexpected
light_sensor: 0 light_avg: 0 idle_time: 0.288000 auto mode screensaver: -1 brightness: 0/255
current brightness: 0
-> set keyboard brightness: -1 -> 0
** (lightum:6408): WARNING **: variant return type is unexpected
light_sensor: 0 light_avg: 0 idle_time: 0.167000 auto mode screensaver: -1 brightness: 0/255
** (lightum:6408): WARNING **: variant return type is unexpected
light_sensor: 0 light_avg: 0 idle_time: 0.469000 auto mode screensaver: -1 brightness: 0/255
** (lightum:6408): WARNING **: variant return type is unexpected
light_sensor: 0 light_avg: 0 idle_time: 0.770000 auto mode screensaver: -1 brightness: 0/255
** (lightum:6408): WARNING **: variant return type is unexpected
light_sensor: 0 light_avg: 0 idle_time: 1.071000 auto mode screensaver: -1 brightness: 0/255
It does not change the keyboard backlight at all.
Can you run the following command and paste it here?
dbus-send --session \
--dest=org.gnome.ScreenSaver \
--type=method_call \
--print-reply \
--reply-timeout=2000 \
/org/gnome/ScreenSaver \
org.gnome.ScreenSaver.GetActive
I get back the following on my Ubuntu 14.10 and 15.04 machines:
method return sender=:1.36 -> dest=:1.418 reply_serial=2
boolean false
I'm not running gnome-screensaver.
In case it matters anyway, this obviously failed:
$ dbus-send --session \
--dest=org.gnome.ScreenSaver \
--type=method_call \
--print-reply \
--reply-timeout=2000 \
/org/gnome/ScreenSaver \
org.gnome.ScreenSaver.GetActive
Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.ScreenSaver was not provided by any .service files
Lightum uses UPower to control the brightness of the keyboard brightness. That could conceivably be the reason that the brightness does not change as needed. Do you have it installed on your Arch Linux machine?
Looking through the code, we utilize the following DBUS interface:
/* UPower */
#define UP_DBUS_SERVICE "org.freedesktop.UPower"
#define UP_DBUS_PATH "/org/freedesktop/UPower/KbdBacklight"
#define UP_DBUS_INTERFACE "org.freedesktop.UPower.KbdBacklight"
and on line 129-133 call the following method
message = g_dbus_message_new_method_call (
UP_DBUS_SERVICE,
UP_DBUS_PATH,
UP_DBUS_INTERFACE,
"SetBrightness");
Yes, I've upower 0.99.2 installed. Keyboard backlight intensity does change, the issue is that it's always changed to 0, regardless of current ambient light level.
On a highly lit room, with the brightness previously maxed out (using kbdlight), running lightum turns it off:
$ lightum -fvd 1 -w 1 -s -i 5
CONFIG:
manualmode: 0
ignoreuser: 1
ignoresession: 0
workmode: 1
queryscreensaver: 1
maxbrightness: 255
minbrightness: 0
maxbacklight: 15
minbacklight: 1
polltime: 300
idleoff: 5
screenidle: 30
fulldim: 0
lightum v2.3.1 running in auto mode
** (lightum:20702): WARNING **: variant return type is unexpected
light_sensor: 2 light_avg: 2 idle_time: 0.103000 auto mode screensaver: -1 brightness: 0/255
current brightness: 255
-> set keyboard brightness: -1 -> 0
** (lightum:20702): WARNING **: variant return type is unexpected
light_sensor: 2 light_avg: 2 idle_time: 0.558000 auto mode screensaver: -1 brightness: 0/255
** (lightum:20702): WARNING **: variant return type is unexpected
light_sensor: 2 light_avg: 2 idle_time: 0.860000 auto mode screensaver: -1 brightness: 0/255
** (lightum:20702): WARNING **: variant return type is unexpected
light_sensor: 2 light_avg: 2 idle_time: 0.110000 auto mode screensaver: -1 brightness: 0/255
With the camera covered (and compelete darkness), it does the same:
$ lightum -fvd 1 -w 1 -s -i 5
CONFIG:
manualmode: 0
ignoreuser: 1
ignoresession: 0
workmode: 1
queryscreensaver: 1
maxbrightness: 255
minbrightness: 0
maxbacklight: 15
minbacklight: 1
polltime: 300
idleoff: 5
screenidle: 30
fulldim: 0
lightum v2.3.1 running in auto mode
** (lightum:21717): WARNING **: variant return type is unexpected
light_sensor: 0 light_avg: 0 idle_time: 0.048000 auto mode screensaver: -1 brightness: 0/255
current brightness: 255
-> set keyboard brightness: -1 -> 0
** (lightum:21717): WARNING **: variant return type is unexpected
light_sensor: 0 light_avg: 0 idle_time: 0.596000 auto mode screensaver: -1 brightness: 0/255
** (lightum:21717): WARNING **: variant return type is unexpected
light_sensor: 0 light_avg: 0 idle_time: 0.897000 auto mode screensaver: -1 brightness: 0/255
** (lightum:21717): WARNING **: variant return type is unexpected
light_sensor: 0 light_avg: 0 idle_time: 0.199000 auto mode screensaver: -1 brightness: 0/255
upower is clearly working, the problem is that lightum sets the brighness to 0, regardless of light_sensor value. (I've no idea what the warning is related to).
I think I've found the problem. I've made a fix to my branch. Would you mind testing once again?
$ lightum -fvd 1 -w 1 -s -i 5
CONFIG:
manualmode: 0
ignoreuser: 1
ignoresession: 0
workmode: 1
queryscreensaver: 1
maxbrightness: 255
minbrightness: 0
maxbacklight: 15
minbacklight: 1
polltime: 300
idleoff: 5
screenidle: 30
fulldim: 0
lightum v2.3.1 running in auto mode
** (lightum:17885): WARNING **: variant return type is unexpected
light_sensor: 2 light_avg: 2 idle_time: 0.022000 auto mode screensaver: 0 brightness: 63/255
current brightness: 0
-> set keyboard brightness: -1 -> 63
** (lightum:17885): WARNING **: variant return type is unexpected
light_sensor: 2 light_avg: 2 idle_time: 0.352000 auto mode screensaver: 0 brightness: 63/255
** (lightum:17885): WARNING **: variant return type is unexpected
light_sensor: 2 light_avg: 2 idle_time: 0.654000 auto mode screensaver: 0 brightness: 63/255
** (lightum:17885): WARNING **: variant return type is unexpected
light_sensor: 2 light_avg: 2 idle_time: 0.956000 auto mode screensaver: 0 brightness: 63/255
** (lightum:17885): WARNING **: variant return type is unexpected
light_sensor: 2 light_avg: 2 idle_time: 0.281000 auto mode screensaver: 0 brightness: 63/255
There's still a warning when running as seen above.
There's now clear changes in brightness, however, they seem to be inverted: the keyboard backlight is turned on when there's lots of light, and turned off when in complete darkness (with a few second delay in each case).
I've updated my branch again to track down the "WARNING **: variant return type is unexpected". With -i 5, it will take 5 seconds before the keyboard light is turned on or off when the light_sensor detects a change in light brightness. If you remove the -i 5, then you will see a much quicker change and decreased delay in brightness adjustment.
In my experience, a light_sensor reading of 1 has a brightness of 127/255 while a light_sensor reading of 2 has brightness of 63/255 and so on and so forth. There should not be an inversion of the keyboard brightness as a result.
When I have my laptop in daylight the keyboard is unlit and when in a darkened room the keyboard has maximal brightness.
Would you mind sending 5 seconds worth of reading when the light_sensors is 0 and > 4?
light_sensors is 0 and > 4
I hadn't even seen light_sensors go beyond 2 before now, even with extremely high light. This last run I've noticed it go up to 3 (for a first time), and I'm with plenty of sunlight and the room light on. I've no idea how to make it go up to (or above) 4. I'd point a reflector at the camera, but I'm not sure if that won't damage the light sensor.
I had forgotten about -i
though, so I've moved the mouse around now during those 5 seconds, and the effect was a bit better:
$ lightum -fvd 1 -w 1 -s -i 5
CONFIG:
manualmode: 0
ignoreuser: 1
ignoresession: 0
workmode: 1
queryscreensaver: 1
maxbrightness: 255
minbrightness: 0
maxbacklight: 15
minbacklight: 1
polltime: 300
idleoff: 5
screenidle: 30
fulldim: 0
lightum v2.3.1 running in auto mode
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.104000 auto mode screensaver: 0 brightness: 42/255
current brightness: 0
-> set keyboard brightness: -1 -> 42
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.352000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.654000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.956000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.255000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.274000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.576000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.877000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.014000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.010000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.016000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.221000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.015000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.011000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.006000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.012000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.032000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.132000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 2 light_avg: 3 idle_time: 0.070000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 3 idle_time: 0.043000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 3 idle_time: 0.007000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 3 idle_time: 0.012000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 3 idle_time: 0.008000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 3 idle_time: 0.011000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 3 idle_time: 0.016000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 0 idle_time: 0.086000 auto mode screensaver: 0 brightness: 255/255
current brightness: 42
-> set keyboard brightness: 42 -> 255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 0 idle_time: 0.008000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 0 idle_time: 0.012000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 0 idle_time: 0.008000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 0 idle_time: 0.012000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 0 idle_time: 0.015000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 0 idle_time: 0.011000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 0 idle_time: 0.014000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 0 idle_time: 0.010000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 0 idle_time: 0.014000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 0 idle_time: 0.009000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 0 idle_time: 0.013000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 0 idle_time: 0.008000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 0 light_avg: 0 idle_time: 0.012000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 0 idle_time: 0.010000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 0 idle_time: 0.013000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 0 idle_time: 0.009000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 0 idle_time: 0.012000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 0 idle_time: 0.008000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 0 idle_time: 0.012000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 0 idle_time: 0.017000 auto mode screensaver: 0 brightness: 255/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.013000 auto mode screensaver: 0 brightness: 42/255
current brightness: 255
-> set keyboard brightness: 255 -> 42
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.009000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.012000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.008000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.014000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.010000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.014000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.009000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.013000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.004000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.015000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.011000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.014000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.010000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.016000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.005000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.015000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.009000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.009000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.012000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.008000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.013000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.009000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.013000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.010000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.014000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.009000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.015000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.009000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.014000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.011000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.015000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.010000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.014000 auto mode screensaver: 0 brightness: 42/255
** (lightum:21756): WARNING **: variant return type is unexpected in get_screensaver_active
light_sensor: 3 light_avg: 3 idle_time: 0.010000 auto mode screensaver: 0 brightness: 42/255
It seems that starting lightum with the webcam covered turns the brightness to max, and starting it with lots of light mere dims (but does not turn off) the brightness (it seems to be a change during one of the latest commits). However, if the keyboard lighting is off and I start lightum, it'll turn it on (with 42/255 brightness), so that's what seems to be confusing me. I believe this is caused because you're expecting light_sensor to go up to >4, and mine doesn't seems to vary only between 0 < x < 3.
Are we sure that all light-sensors go from 0-5? Might mine be buggy?
My light sensor goes from 0 to at least 50-60. Do you mind printing out the value of /sys/devices/platform/applesmc.768/light
in both dark and very bright conditions? Which macbook are you using?
Also, the WARNING **: variant return type is unexpected in get_screensaver_active
just states that you don't have gnome-screensaver and it's DBUS method installed on your system. Nonetheless, the software now compensates for that missing piece as it returns 0 when it doesn't detect it.
Sunlight coming in through the window + room lights. I can't get much more than that without using a reflector pointed at the sensor, and I'm afraid that might damage it:
$ cat /sys/devices/platform/applesmc.768/light
(4,0)
Covering the webcam with my finger:
$ cat /sys/devices/platform/applesmc.768/light
(0,0)
It's a 13" MacBook Air 2013.
Also, the WARNING **: variant return type is unexpected in get_screensaver_active just states that you don't have gnome-screensaver and it's DBUS method installed on your system. [...]
Why use just gnome-screensaver specific code? We have the xdg's org.freedesktop.ScreenSaver
DBUS endpoint.
Nonetheless, the software now compensates for that missing piece as it returns 0 when it doesn't detect it.
I've noticed this, and it seemed to make a positive change.
This light sensor range might be an issue with the applesmc module. I found this patch included in previous Ubuntu versions where others had these problems as well. https://launchpadlibrarian.net/21101822/applesmc-dkms-light-sensor-fix.patch
Unfortunately, it doesn't seem to be applied upstream in any case. I would try it and see if it makes a difference for you.
Thanks for pointing out the xdg org.freedesktop.ScreenSaver
DBUS endpoint. I've incorporated it into my branch.
Never mind. I spoke too soon and it looks like it has been included already. But I think there might be a module issue though.
Running the latest from git the keyboard backlighting behaviour is inconsistent. Either with plenty of light or in complete darkness (eg: covering the webcam with my finger) the keyboard backlight is turned off.
I noticed (before #44), that sometimes the backlight it turned back on, but have had issues reproducing it: it seemed to be rather random.
I've been running
lightum -fvd 1 -w 1 -s -i 5
.I've tried the code from #44, as suggested on #45, but this did not affect the issue at all.
Covering the webcam:
In a very well lit environment: