View Single Post
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#30
Originally Posted by austin View Post
Then in n810.conf, you can configure these events as you wish, e.g. display_state_off = call keyboard_light_off
This didn't work until I called n810 versions from commo.conf like this
Code:
display_state_on = if $isN810 n810.keys.display_state_on
display_state_off = if $isN810 n810.keys.display_state_off
display_state_dimmed = if $isN810 n810.keys.display_state_dimmed
then I modified n810.conf to set few variables and call sudo only once if needed
Code:
[keys]
display_state_on = if $is_slide_open keyboard_light_on
display_state_off = if $is_slide_open keyboard_light_off
display_state_dimmed = if $is_slide_open keyboard_light_off

hal_org_freedesktop_Hal_devices_platform_kb_lock_button_state_value = if $1 key_press_kb_lock key_release_kb_lock
key_press_kb_lock = switch tklock.main
key_release_kb_lock =
hal_org_freedesktop_Hal_devices_platform_slide_button_state_value = if $1 keyboard_slide_close keyboard_slide_open
keyboard_slide_open = set is_slide_open 1 ; if $islocked unlock_keys ; call keyboard_light_on

# relock if you quickly open and then close the keyboard
unlock_keys = call tklock.main.unlock; set relock 1; timer_set n810.keys.keep_unlocked 10
keep_unlocked = set relock 0
keyboard_slide_close = set is_slide_open 0 ; if $relock tklock.main.lock ; call keyboard_light_off

keyboard_light_on = if $is_kb_light_on nop set_keyboard_light_on ; set is_kb_light_on 1
keyboard_light_off = if $is_kb_light_on set_keyboard_light_off ; set is_kb_light_on 0
set_keyboard_light_on = exec "sudo /etc/powerlaunch/kb_light"
set_keyboard_light_off = exec "sudo /etc/powerlaunch/kb_light off"
This works fine, keyboard light is turned off on display dim or off. The only small bug is that it doesn't work correctly at first until variables are initialized by opening/closing slide, then it is OK.
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.