Skip to content

Instantly share code, notes, and snippets.

@Utopiah
Created December 1, 2021 11:09
Show Gist options
  • Save Utopiah/346c2d11acdcd8e254fa57489ad5f50f to your computer and use it in GitHub Desktop.
Save Utopiah/346c2d11acdcd8e254fa57489ad5f50f to your computer and use it in GitHub Desktop.
#pragma once
#undef RGBLIGHT_ANIMATIONS
#define RGBLIGHT_EFFECT_BREATHING
#define RGBLIGHT_EFFECT_CHRISTMAS
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
#define RGBLIGHT_EFFECT_SNAKE
#include QMK_KEYBOARD_H
#define _MAIN 0
#define _FN 1
#define KC_X0 LT(_FN, KC_ESC)
#ifdef RGBLIGHT_ENABLE
// How long (in ms) to wait between animation steps for the rainbow mode
const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {60, 30, 15};
// How long (in milliseconds) to wait between animation steps for each of the "Swirling rainbow" animations
const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {20, 10, 4};
#endif
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_MAIN] = LAYOUT_ortho_2x4(
KC_X, MEH(KC_O), MEH(KC_L), HYPR(KC_HASH),
LCTL(KC_D), LCTL(KC_F), LCTL(KC_HOME), MO(_FN)
),
[_FN] = LAYOUT_ortho_2x4(
RGB_TOG, RGB_MOD, RGB_M_R, RGB_M_SN,
BL_TOGG, BL_STEP, RESET, _______
)
};
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
}
void oled_task_user(void) {
// Host Keyboard Layer Status
oled_write_ln_P(PSTR("FABIEN MacroPad 8"), false);
oled_write_P(PSTR("Active layer: "), false);
switch (get_highest_layer(layer_state)) {
case _MAIN:
oled_write_ln_P(PSTR("OBS"), false);
backlight_set(0);
break;
case _FN:
oled_write_ln_P(PSTR("FN"), false);
backlight_set(3);
break;
default:
// Or use the write_ln shortcut over adding '\n' to the end of your string
oled_write_ln_P(PSTR("N/A"), false);
}
// Host Keyboard LED Status
oled_write_P(PSTR("Backlit: "), false);
oled_write_ln_P(is_backlight_enabled() ? PSTR("On") : PSTR("Off"), false);
oled_write_ln_P("\n", false);
oled_write_ln_P("\n", false);
oled_write_ln_P("\n", false);
#ifdef RGBLIGHT_ENABLE
static char rgbStatusLine1[26] = {0};
snprintf(rgbStatusLine1, sizeof(rgbStatusLine1), "RGB Mode: %d", rgblight_get_mode());
oled_write_ln(rgbStatusLine1, false);
static char rgbStatusLine2[26] = {0};
snprintf(rgbStatusLine2, sizeof(rgbStatusLine2), "h:%d s:%d v:%d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val());
oled_write_ln(rgbStatusLine2, false);
#endif
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment