diff --git a/data/keyd-application-mapper.1.gz b/data/keyd-application-mapper.1.gz index df976ff..4102fcc 100644 Binary files a/data/keyd-application-mapper.1.gz and b/data/keyd-application-mapper.1.gz differ diff --git a/data/keyd.1.gz b/data/keyd.1.gz index 00b60ab..dae43fa 100644 Binary files a/data/keyd.1.gz and b/data/keyd.1.gz differ diff --git a/docs/keyd.scdoc b/docs/keyd.scdoc index f0f3950..8f00192 100644 --- a/docs/keyd.scdoc +++ b/docs/keyd.scdoc @@ -547,7 +547,10 @@ any of the following options: *macro_repeat_timeout:* The time separating successive executions of a macro. (default: 50) - *layer_indicator:* If set, this will turn the capslock light on whenever a layer is active. + *layer_indicator:* If set, this will turn the capslock light on whenever a layer is active. + Note: Some wayland compositors will aggressively toggle LED state rendering this option + unusable. + (default: 0) *macro_sequence_timeout:* If set, this will add a timeout (*in diff --git a/src/daemon.c b/src/daemon.c index f74ee06..3558f19 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -85,9 +85,17 @@ static void on_layer_change(const struct keyboard *kbd, const char *name, uint8_ size_t n = 0; if (kbd->config.layer_indicator) { + int active_layers = 0; + + for (i = 1; i < kbd->config.nr_layers; i++) + if (kbd->config.layers[i].type != LT_LAYOUT && kbd->layer_state[i].active) { + active_layers = 1; + break; + } + for (i = 0; i < device_table_sz; i++) if (device_table[i].data == kbd) - device_set_led(&device_table[i], 1, state); + device_set_led(&device_table[i], 1, active_layers); } if (!nr_listeners)