Skip to content

Commit

Permalink
jorne: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
xkonni committed Oct 18, 2024
1 parent 608b0e8 commit 457cebc
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 548 deletions.
44 changes: 44 additions & 0 deletions keyboards/jorne/lib/logo.c → keyboards/jorne/jorne.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,48 @@ static void render_logo(void) {
};
oled_write_raw_P(raw_logo, sizeof(raw_logo));
}

enum layers {
_QWERTY = 0,
_LOWER,
_RAISE,
_ADJUST,
};

static void render_status(void) {
// Host Keyboard Layer Status
oled_write_P(PSTR("Layer: "), false);
switch (get_highest_layer(layer_state)) {
case _QWERTY:
oled_write_P(PSTR("Default\n"), false);
break;
case _LOWER:
oled_write_P(PSTR("Lower\n"), false);
break;
case _RAISE:
oled_write_P(PSTR("Raise\n"), false);
break;
case _ADJUST:
oled_write_P(PSTR("Adjust\n"), false);
break;
default:
oled_write_P(PSTR("Undefined\n"), false);
}

// Host Keyboard LED Status
led_t led_state = host_keyboard_led_state();
oled_write_P(led_state.num_lock ? PSTR("NUMLCK ") : PSTR(" "), false);
oled_write_P(led_state.caps_lock ? PSTR("CAPLCK ") : PSTR(" "), false);
oled_write_P(led_state.scroll_lock ? PSTR("SCRLCK ") : PSTR(" "), false);
}

bool oled_task_kb(void) {
if (!oled_task_user()) { return false; }
if (is_keyboard_left()) {
render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
} else {
render_logo();
}
return true;
}
#endif
2 changes: 1 addition & 1 deletion keyboards/jorne/keymaps/hellonavivial/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
VIA_ENABLE = yes
VIAL_ENABLE = yes
# Bootloader selection
Expand Down
18 changes: 0 additions & 18 deletions keyboards/jorne/keymaps/xk_vial/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,6 @@
#define VIAL_UNLOCK_COMBO_ROWS {0, 0}
#define VIAL_UNLOCK_COMBO_COLS {0, 1}

#ifdef RGBLIGHT_ENABLE
#define RGBLIGHT_EFFECT_BREATHING
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
#define RGBLIGHT_EFFECT_SNAKE
#define RGBLIGHT_EFFECT_KNIGHT
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
#define RGBLIGHT_EFFECT_RGB_TEST
#define RGBLIGHT_EFFECT_ALTERNATING
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#endif

// choose IS_LEFT or IS_RIGHT for compilation and flash firmware
#define IS_LEFT 1
// #define IS_RIGHT 1

// If you are using an Elite C rev3 on the slave side, uncomment the lines below:
// #define SPLIT_USB_DETECT
// #define NO_USB_STARTUP_CHECK
109 changes: 41 additions & 68 deletions keyboards/jorne/keymaps/xk_vial/keymap.c
Original file line number Diff line number Diff line change
@@ -1,74 +1,65 @@
// Copyright 2021 Joric (@joric)
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
// #include "lib/logo.h"
#include "lib/bongocat/bongocat.h"
#include "lib/layer_status/layer_status.h"

// QWERTY
#define ESC_LCT MT(MOD_LCTL, KC_ESC)
#define QUO_LWR LT(_LOWER, KC_QUOT)
#define Z_LALT MT(MOD_LALT, KC_Z)
#define LT1_LGU LM(1, MOD_LGUI)
#define FN_MO13 QK_TRI_LAYER_LOWER
#define FN_MO23 QK_TRI_LAYER_UPPER
// RAISE
#define RSE_GRV LSFT(KC_GRAVE)
#define RSE_1 LSFT(KC_1)
#define RSE_2 LSFT(KC_2)
#define RSE_3 LSFT(KC_3)
#define RSE_4 LSFT(KC_4)
#define RSE_5 LSFT(KC_5)
#define RSE_6 LSFT(KC_6)
#define RSE_7 LSFT(KC_7)
#define RSE_8 LSFT(KC_8)
#define RSE_9 LSFT(KC_9)
#define RSE_0 LSFT(KC_0)
#define RSE_MNS LSFT(KC_MINS)
#define RSE_EQL LSFT(KC_EQL)
#define RSE_LBR LSFT(KC_LBRC)
#define RSE_RBR LSFT(KC_RBRC)
#define RSE_BSL LSFT(KC_BSLS)

enum layers {
_QWERTY = 0,
_LOWER,
_RAISE,
_ADJUST,
};


enum custom_keycodes {
RGBRST = SAFE_RANGE
};

#define RBR_RGU MT(MOD_RGUI, KC_RBRC)
#define F12_RGU MT(MOD_RGUI, KC_F12)
#define PLS_LCT MT(MOD_LCTL, KC_PPLS)
#define EQL_LCT MT(MOD_LCTL, KC_PEQL)
#define APP_LCT MT(MOD_LCTL, KC_APP)
#define EQL_RCT MT(MOD_RCTL, KC_PEQL)
#define QUO_RCT MT(MOD_RCTL, KC_QUOT)
#define APP_RCT MT(MOD_RCTL, KC_APP)
#define MIN_RCT MT(MOD_RCTL, KC_MINS)
#define EQL_LAL MT(MOD_LALT, KC_EQL)
#define BSL_RAL MT(MOD_RALT, KC_BSLS)
#define BSP_LSH MT(MOD_LSFT, KC_BSPC)
#define DEL_RSE LT(_RAISE, KC_DEL)
#define TAB_RSE LT(_RAISE, KC_TAB)
#define ENT_LWR LT(_LOWER, KC_ENT)
#define ESC_LWR LT(_LOWER, KC_ESC)

#define ESC_LCT MT(MOD_LCTL, KC_ESC)
#define QUO_LWR LT(_LOWER, KC_QUOT)
#define Z_LALT MT(MOD_LALT, KC_Z)


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[_QWERTY] = LAYOUT(
_______, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, _______,
KC_ESC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_DEL,
ESC_LCT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, QUO_LWR,
KC_LSFT, Z_LALT, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LGUI, MO(1), KC_SPC, KC_ENTER, MO(2), KC_RALT
LT1_LGU, FN_MO13, KC_SPC, KC_ENTER,FN_MO23, KC_RALT
),

[_LOWER] = LAYOUT(
_______, KC_UNDS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, F12_RGU,
PLS_LCT, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, KC_RPRN, MIN_RCT,
EQL_LAL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
_______, _______, _______, _______, _______, _______
KC_TRNS, KC_GRAVE,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, KC_TRNS,
KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, KC_TRNS,
KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, KC_NO, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_INS, KC_PSCR,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),

[_RAISE] = LAYOUT(
_______, KC_NUM, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_VOLU, KC_HOME, KC_PSCR, KC_PGUP, KC_SCRL, KC_CAPS, _______,
EQL_LCT, KC_PAST, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_MUTE, KC_LEFT, KC_UP, KC_RGHT, KC_INS, APP_RCT,
_______, KC_P0, KC_P1, KC_P2, KC_P3, KC_PCMM, KC_VOLD, KC_END, KC_DOWN, KC_PGDN, KC_PAUS, _______,
_______, _______, _______, _______, _______, _______
KC_TRNS, RSE_GRV, RSE_1, RSE_2, RSE_3, RSE_4, RSE_5, RSE_6, RSE_7, RSE_8, RSE_9, RSE_0, KC_TRNS, KC_TRNS,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RSE_MNS, RSE_EQL, RSE_LBR, RSE_RBR, RSE_BSL, KC_NO,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),

[_ADJUST] = LAYOUT(
QK_BOOT, RGBRST, AS_UP, AS_TOGG, AS_DOWN, _______, _______, _______, _______, AS_DOWN, AS_TOGG, AS_UP, RGBRST, QK_BOOT,
RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, RGB_VAI, RGB_SAI, RGB_HUI, RGB_TOG,
RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, RGB_VAD, RGB_SAD, RGB_HUD, RGB_MOD,
_______, SH_TOGG, _______, _______, SH_TOGG, _______
),

KC_TRNS, KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_TRNS,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F12,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
)
};

layer_state_t layer_state_set_user(layer_state_t state) {
Expand All @@ -77,29 +68,11 @@ layer_state_t layer_state_set_user(layer_state_t state) {

#ifdef OLED_ENABLE
bool oled_task_user(void) {
// if (is_keyboard_left()) {
// render_bongocat();
// // oled_write_P(get_u8_str(get_current_wpm(), ' '), false);
// }
// else {
// render_layer_status();
// // oled_write_P(get_u8_str(get_current_wpm(), ' '), false);
// }
render_layer_status();
return true;
return false;
}
#endif

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case RGBRST:
#ifdef RGBLIGHT_ENABLE
if (record->event.pressed) {
eeconfig_update_rgblight_default();
rgblight_enable();
}
#endif
break;
}
return true;
}
28 changes: 3 additions & 25 deletions keyboards/jorne/keymaps/xk_vial/rules.mk
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
# SRC += ./lib/logo.c
SRC += ./lib/layer_status/layer_status.c
SRC += ./lib/bongocat/bongocat.c

VIA_ENABLE = yes
VIA_ENABLE = yes
VIAL_ENABLE = yes
LTO_ENABLE = yes # compile optimization, reduce size

# Can't have RGBLIGHT and RGB_MATRIX at the same time.
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = ws2812
VIALRGB_ENABLE = yes

OLED_ENABLE = yes
OLED_DRIVER = ssd1306
COMBO_ENABLE = no
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
SPACE_CADET_ENABLE = yes # ( on tap L_SFT, ) on tap R_SFT

# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
QMK_SETTINGS = no

WPM_ENABLE = yes
VIALRGB_ENABLE = yes
SRC += ./lib/layer_status/layer_status.c
Loading

0 comments on commit 457cebc

Please sign in to comment.