Bootmapper - change RGB on layer switch

Not sure if this is possible with Bootmapper Client, but I’d like to be able to change the RGB effect when I switch to a layer.

Specifically, I have a key mapped to FN2 Toggle, and I’d like to have the RGB effect change when FN2 is active, then change back when returning to the Normal layer. Is this possible with Bootmapper Client, or would I need something like QMK for it?

1 Like

I don’t know Bootmapper, but I can tell you it’s possible with QMK, because I’ve done it at least once. I can have a look for the code if you’re interested.

3 Likes

Right now I’m using a Bootmapper PCB unfortunately. Sharing code never hurts, of course, but I don’t think I’m up for converting this board to QMK right now.

Would you mind sharing it for QMK? That’s something I’m interested in.

Please and thank you!

1 Like

@Fsund that’s a super cool feature.

uint32_t layer_state_set_user(uint32_t state) {
    rgblight_config_t eeprom;
    switch (biton32(state)) {
        case _FN:
            rgblight_setrgb(0xFF, 0x33, 0x00);
            rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
            break;
        default:
            eeprom.raw = eeconfig_read_rgblight();
            rgblight_mode_noeeprom(eeprom.mode);
            break;
    }
    return state;
}

This is how I usually do it:
Add the above function to your keymap.c and adapt to your needs.

  • case _FN → _FN is the name of the layer. If you use numbers instead of names for layers just use those
  • replace the rgb_ Funtctions with the ones you want to use. I’d advise to use the noeeprom functions where possible.
  • the default state restores the RGB configuration from your base layer. This only works thought if you have used the noeeprom functions as stated above.

Results in this:

Hope this helps you out and please don’t hesitate to ask any questions, will try my best to help out :slight_smile:

2 Likes

You beat me to it :smile: That’s about the same way I do it.

(All hail the “Caps is FN” overlords!)

2 Likes

I’ve done something similar to what you are asking for using QMK _on a bootmapperclient board (the pearl), except I used indicator LEDs instead of underglow if you want to check it out.