summaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
authorMatthew Lyon <matthew@lyonheart.us>2020-07-21 17:08:56 -0700
committerGitHub <noreply@github.com>2020-07-21 17:08:56 -0700
commit3f96b88e73ea72474d841c1318c62b570f4aaf34 (patch)
tree9e3871d57e3f73ecfa0c71cd30cb802668c4d6ec /users
parent5e812cc4bea41688a7dd7cfc228cc5bc0cf23617 (diff)
mattly goes windows (#9677)
* mattly's userspace and iris * [Keymap] mattly's windows overlays * biton32->get_highest_layer * few more small tweaks
Diffstat (limited to 'users')
-rw-r--r--users/mattly/config.h3
-rw-r--r--users/mattly/mattly.c31
-rw-r--r--users/mattly/mattly.h72
-rw-r--r--users/mattly/rules.mk3
4 files changed, 64 insertions, 45 deletions
diff --git a/users/mattly/config.h b/users/mattly/config.h
index 25d3798011..0f7ce4a64b 100644
--- a/users/mattly/config.h
+++ b/users/mattly/config.h
@@ -1,8 +1,5 @@
#pragma once
-// Most tactile encoders have detents every 4 stages
-#define ENCODER_RESOLUTION 4
-
#define IGNORE_MOD_TAP_INTERRUPT
#define PERMISSIVE_HOLD
#define TAPPING_TOGGLE 2
diff --git a/users/mattly/mattly.c b/users/mattly/mattly.c
index 1e61e01265..d097c8cd7b 100644
--- a/users/mattly/mattly.c
+++ b/users/mattly/mattly.c
@@ -5,48 +5,51 @@ layer_state_t layer_state_set_keymap (layer_state_t state) {
return state;
}
+static uint16_t current_state = 0;
+
void set_lights_default(void) {
#ifdef RGBLIGHT_ENABLE
if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
rgblight_sethsv_noeeprom(HSV_CAPS);
} else {
- rgblight_sethsv_noeeprom(HSV_DEFAULT);
+ if (current_state == _BASE_MAC) {
+ rgblight_sethsv_noeeprom(HSV_MAC);
+ } else if (current_state == _OVER_WIN) {
+ rgblight_sethsv_noeeprom(HSV_WIN);
+ }
}
#endif
}
void layer_state_set_rgb(layer_state_t state) {
#ifdef RGBLIGHT_ENABLE
- switch (biton32(state)) {
- case _QWERTY:
- set_lights_default();
- break;
+ switch (get_highest_layer(state)) {
case _SYMBOL:
rgblight_sethsv_noeeprom(HSV_SYMBOL);
break;
case _NAVNUM:
+ case _NAVNUM_WIN:
rgblight_sethsv_noeeprom(HSV_NAVNUM);
break;
case _FUNCT:
+ case _FUNCT_WIN:
rgblight_sethsv_noeeprom(HSV_FUNCT);
break;
+ default:
+ set_lights_default();
}
#endif
}
-
layer_state_t layer_state_set_user (layer_state_t state) {
state = update_tri_layer_state(state, _SYMBOL, _NAVNUM, _FUNCT);
+ state = update_tri_layer_state(state, _OVER_WIN, _NAVNUM, _NAVNUM_WIN);
+ state = update_tri_layer_state(state, _OVER_WIN, _FUNCT, _FUNCT_WIN);
+ current_state = get_highest_layer(state);
layer_state_set_rgb(state);
return layer_state_set_keymap (state);
}
-void on_reset(void) {
- #ifdef RGBLIGHT_ENABLE
- rgblight_sethsv_noeeprom(HSV_RESET);
- #endif
-}
-
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_CAPS:
@@ -55,7 +58,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#endif
return true;
case RESET:
- on_reset();
+ #ifdef RGBLIGHT_ENABLE
+ rgblight_sethsv_noeeprom(HSV_RESET);
+ #endif
return true;
default:
return true;
diff --git a/users/mattly/mattly.h b/users/mattly/mattly.h
index da09ddcdb2..5f6b7c5f09 100644
--- a/users/mattly/mattly.h
+++ b/users/mattly/mattly.h
@@ -20,12 +20,18 @@
#include "quantum.h"
enum {
- _QWERTY,
+ _BASE_MAC,
+ _OVER_WIN,
_NAVNUM,
+ _NAVNUM_WIN,
_SYMBOL,
_FUNCT,
+ _FUNCT_WIN,
};
+// == System
+#define TOG_WIN TG(_OVER_WIN)
+
// == Thumbs
// left hand
#define ESC_HYP MT(MOD_HYPR, KC_ESC)
@@ -33,7 +39,6 @@ enum {
#define SPC_SFT MT(MOD_LSFT, KC_SPC)
#define ENT_SYM LT(_SYMBOL, KC_ENT)
-
// right hand
#define SPC_SFT MT(MOD_LSFT, KC_SPC)
#define BSP_SYM LT(_SYMBOL, KC_BSPC)
@@ -45,52 +50,63 @@ enum {
// == QWERTY
// left hand home row
-#define A_CTRL MT(MOD_LCTL, KC_A)
-#define S_ALT MT(MOD_LALT, KC_S)
-#define D_GUI MT(MOD_LGUI, KC_D)
-#define F_SHFT MT(MOD_LSFT, KC_F)
+#define A_CTL MT(MOD_LCTL, KC_A)
+#define A_GUI MT(MOD_LGUI, KC_A)
+#define S_ALT MT(MOD_LALT, KC_S)
+#define D_GUI MT(MOD_LGUI, KC_D)
+#define D_CTL MT(MOD_LCTL, KC_D)
+#define F_SFT MT(MOD_LSFT, KC_F)
// left hand aux
-#define W_CTRL MT(MOD_LCTL, KC_W)
+#define W_CTL MT(MOD_LCTL, KC_W)
+#define W_GUI MT(MOD_LGUI, KC_W)
#define E_ALT MT(MOD_LALT, KC_E)
#define R_GUI MT(MOD_LGUI, KC_R)
+#define R_CTL MT(MOD_LCTL, KC_R)
// right hand home row
-#define J_SHFT MT(MOD_RSFT, KC_J)
+#define J_SFT MT(MOD_RSFT, KC_J)
#define K_GUI MT(MOD_RGUI, KC_K)
+#define K_CTL MT(MOD_RCTL, KC_K)
#define L_ALT MT(MOD_RALT, KC_L)
#define MINSCTL MT(MOD_RCTL, KC_MINS)
+#define MINSGUI MT(MOD_RGUI, KC_MINS)
// right hand aux
#define U_GUI MT(MOD_RGUI, KC_U)
+#define U_CTL MT(MOD_RCTL, KC_U)
#define I_ALT MT(MOD_RALT, KC_I)
-#define O_CTRL MT(MOD_RCTL, KC_O)
+#define O_CTL MT(MOD_RCTL, KC_O)
+#define O_GUI MT(MOD_RGUI, KC_O)
// == OS X default keys
// movement by word
-#define BWORD LALT(KC_LEFT)
-#define FWORD LALT(KC_RIGHT)
+#define M_BWORD LALT(KC_LEFT)
+#define W_BWORD LCTL(KC_LEFT)
+#define M_FWORD LALT(KC_RIGHT)
+#define W_FWORD LCTL(KC_RIGHT)
// gui navigation
-#define NWIN LGUI(KC_GRV) // Next Window
-#define PWIN LGUI(LSFT(KC_GRV)) // Prev Window
-#define NTAB LGUI(LSFT(KC_RBRC)) // Next Tab
-#define PTAB LGUI(LSFT(KC_LBRC)) // Prev Tab
-#define NAVBACK LGUI(KC_LBRC) // Navigate Forward
-#define NAVFWD LGUI(KC_RBRC) // Navigate Back
-
-// my personal mappings to window manager commands
-#define XALLWIN HYPR(KC_F14)
-#define XDESKTP HYPR(KC_F15)
-#define XNXTSPC HYPR(KC_F16)
-#define XPRVSPC HYPR(KC_F17)
-#define XNOTIFY HYPR(KC_F18)
+#define M_NXWIN LGUI(KC_GRV) // Next Window
+#define W_NXWIN LALT(KC_TAB)
+#define M_PVWIN LGUI(LSFT(KC_GRV)) // Prev Window
+#define W_PVWIN LALT(LSFT(KC_TAB))
+#define M_NXTAB LGUI(LSFT(KC_RBRC)) // Next Tab
+#define W_NXTAB LCTL(KC_PGDN)
+#define M_PVTAB LGUI(LSFT(KC_LBRC)) // Prev Tab
+#define W_PVTAB LCTL(KC_PGUP)
+#define M_NAVBK LGUI(KC_LBRC) // Navigate Forward
+#define W_NAVBK LALT(KC_LEFT)
+#define M_NAVFW LGUI(KC_RBRC) // Navigate Back
+#define W_NAVFW LALT(KC_RIGHT)
// == UNDERGLOW
#ifdef RGBLIGHT_ENABLE
-#define HSV_CAPS 60, 255, 255
-#define HSV_DEFAULT 30, 255, 255
-#define HSV_SYMBOL 18, 255, 255
+#define HSV_CAPS 55, 255, 255
+#define HSV_ERR 30, 196, 196
+#define HSV_MAC 20, 255, 128
+#define HSV_WIN 10, 255, 128
+#define HSV_SYMBOL 235, 255, 255
#define HSV_NAVNUM 250, 255, 255
-#define HSV_FUNCT 238, 255, 255
+#define HSV_FUNCT 210, 255, 255
#define HSV_RESET 180, 255, 255
#endif
diff --git a/users/mattly/rules.mk b/users/mattly/rules.mk
index 6803d361d8..85cdcc91f0 100644
--- a/users/mattly/rules.mk
+++ b/users/mattly/rules.mk
@@ -1,2 +1,3 @@
SRC += mattly.c
-MOUSEKEY_ENABLE = yes
+LTO_ENABLE = yes
+CONSOLE_ENABLE = yes