Skip to content

Commit

Permalink
refactor: switch win and android layers (macos by default) (#40)
Browse files Browse the repository at this point in the history
* change layer notifiers function keys
* update caps notification keys
* change help layers
* change help keyboard layout
* create a new keymap by name
* fix alt modifier on STG layer
* fix application window position key
* remove key name helper
* refactor: rename all folder as shared
* refactor: reorder mac with priority over windows
* feat: add secure bluethoot clear morph
* feat: change bluetooth key
* refactor: update STG layer images
* refactor: android STG layer
* fix: device order switchig profiles
  • Loading branch information
equiman committed Aug 3, 2024
1 parent 8be73e7 commit dfeb27c
Show file tree
Hide file tree
Showing 21 changed files with 132 additions and 74 deletions.
Binary file modified .github/images/layers/android/STG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/images/layers/macos/STG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/images/layers/windows/STG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"cSpell.words": [
"ASLD",
"ASLM",
"ASLT",
"ASLU",
"ASRD",
"ASRM",
"ASRT",
"ASRU",
"ASTRK",
"bootloader",
"BSLH",
Expand Down
56 changes: 28 additions & 28 deletions config/corne.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
#include <dt-bindings/zmk/bt.h>

/* Global */
#include "os/all/times.dtsi"
#include "os/all/general.dtsi"
#include "os/windows/layers.dtsi"
#include "os/shared/times.dtsi"
#include "os/shared/general.dtsi"
#include "os/macos/layers.dtsi"
#include "os/windows/layers.dtsi"
#include "os/android/layers.dtsi"

/* Keys */
#include "os/all/keys.dtsi"
#include "os/windows/keys.dtsi"
#include "os/shared/keys.dtsi"
#include "os/macos/keys.dtsi"
#include "os/windows/keys.dtsi"
#include "os/android/keys.dtsi"

/* Helpers */
Expand All @@ -28,17 +28,17 @@

/ {
macros {
#include "os/all/macros/layers.dtsi"
#include "os/all/macros/settings.dtsi"

#include "os/windows/macros/layers.dtsi"
#include "os/windows/macros/int.dtsi"
#include "os/windows/macros/dev.dtsi"
#include "os/shared/macros/layers.dtsi"
#include "os/shared/macros/settings.dtsi"

#include "os/macos/macros/layers.dtsi"
#include "os/macos/macros/int.dtsi"
#include "os/macos/macros/dev.dtsi"

#include "os/windows/macros/layers.dtsi"
#include "os/windows/macros/int.dtsi"
#include "os/windows/macros/dev.dtsi"

#include "os/android/macros/layers.dtsi"
#include "os/android/macros/int.dtsi"
#include "os/android/macros/dev.dtsi"
Expand All @@ -48,19 +48,9 @@

/ {
behaviors {
#include "os/all/morph/shared.dtsi"
#include "os/all/morph/num.dtsi"
#include "os/all/hold/shared.dtsi"

#include "os/windows/morph/layers.dtsi"
#include "os/windows/morph/base.dtsi"
#include "os/windows/morph/int.dtsi"
#include "os/windows/morph/actions.dtsi"
#include "os/windows/morph/dev.dtsi"
#include "os/windows/morph/settings.dtsi"
#include "os/windows/hold/layers.dtsi"
#include "os/windows/hold/base.dtsi"
#include "os/windows/hold/dev.dtsi"
#include "os/shared/morph/shared.dtsi"
#include "os/shared/morph/num.dtsi"
#include "os/shared/hold/shared.dtsi"

#include "os/macos/morph/layers.dtsi"
#include "os/macos/morph/base.dtsi"
Expand All @@ -73,6 +63,16 @@
#include "os/macos/hold/dev.dtsi"
#include "os/macos/hold/settings.dtsi"

#include "os/windows/morph/layers.dtsi"
#include "os/windows/morph/base.dtsi"
#include "os/windows/morph/int.dtsi"
#include "os/windows/morph/actions.dtsi"
#include "os/windows/morph/dev.dtsi"
#include "os/windows/morph/settings.dtsi"
#include "os/windows/hold/layers.dtsi"
#include "os/windows/hold/base.dtsi"
#include "os/windows/hold/dev.dtsi"

#include "os/android/morph/layers.dtsi"
#include "os/android/morph/base.dtsi"
#include "os/android/morph/int.dtsi"
Expand All @@ -86,12 +86,12 @@
combos {
compatible = "zmk,combos";

#include "os/windows/combos/base.dtsi"
#include "os/windows/combos/help.dtsi"

#include "os/macos/combos/base.dtsi"
#include "os/macos/combos/help.dtsi"

#include "os/windows/combos/base.dtsi"
#include "os/windows/combos/help.dtsi"

#include "os/android/combos/base.dtsi"
};
};
Expand All @@ -100,8 +100,8 @@
keymap {
compatible = "zmk,keymap";

#include "os/windows/keymap.dtsi"
#include "os/macos/keymap.dtsi"
#include "os/windows/keymap.dtsi"
#include "os/android/keymap.dtsi"
};
};
78 changes: 58 additions & 20 deletions config/os/android/keymap.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -106,27 +106,65 @@
};

android_settings_layer {
#define AS10 &kp LG(N) // tap: notifications
#define AS11 &m_as_a // tap: apps
#define AS12 &kp LG(K) // tap: shortcuts
#define AS24 &bt BT_CLR // tap: clear Bluetooth

#define AS22 &kp LG(RET) // tap: home
#define AS23 &kp LG(FSLH) // tap: keyboard shortcuts

#define AS04 &kp LG(B) // tap: browser
#define AS05 &kp LCMD // tap: assist
#define AS16 &kp LG(L) // tap: calendar
#define AS17 &kp LG(P) // tap: music
#define AS28 &kp LG(E) // tap: mail
#define AS29 &kp LG(C) // tap: contacts

display-name = "aSTG";
#define ASLU0 MKY_ESC
#define ASLU1 &m_s_b1
#define ASLU2 &m_s_b2
#define ASLU3 &none
#define ASLU4 &kp LG(B) // tap: browser
#define ASLU5 &kp LCMD // tap: assist

#define ASLM0 &none
#define ASLM1 &m_s_b3
#define ASLM2 &m_s_b4
#define ASLM3 &none
#define ASLM4 &kp LG(L) // tap: calendar
#define ASLM5 &kp LG(P) // tap: music

#define ASLD0 &mp_sSTG_cb // tap: none | shift: clear current profile | alt: clear all profiles
#define ASLD1 &m_s_b5
#define ASLD2 &m_s_b6
#define ASLD3 &none
#define ASLD4 &kp LG(E) // tap: mail
#define ASLD5 &kp LG(C) // tap: contacts


#define ASRU0 &kp C_VOL_UP
#define ASRU1 &none
#define ASRU2 &none
#define ASRU3 &none
#define ASRU4 &kp LG(N) // tap: notifications
#define ASRU5 &m_as_a // tap: apps

#define ASRM0 &kp C_MUTE
#define ASRM1 &hm RSHFT C_PREV // tap: previous
#define ASRM2 &hm LALT C_PP // tap: play/pause
#define ASRM3 &kp C_NEXT // tap: next
#define ASRM4 &kp LG(RET) // tap: home
#define ASRM5 &kp LG(FSLH) // tap: keyboard shortcuts

#define ASRD0 &kp C_VOL_DN
#define ASRD1 &none
#define ASRD2 &none
#define ASRD3 &none
#define ASRD4 &none
#define ASRD5 &none


#define ASLT2 &kp C_BRI_DN
#define ASLT1 KEY_SPC
#define ASLT0 &to_aBAS

#define ASRT0 &to_aAXN
#define ASRT1 MKY_RET
#define ASRT2 &kp C_BRI_UP


display-name = "mSTG";
bindings = <
AKY_ESC &m_s_b1 &m_s_b2 &none AS04 AS05 &none &kp K_VOL_DN &kp K_MUTE &kp K_VOL_UP AS10 AS11
AS12 &m_s_b3 &m_s_b4 &none AS16 AS17 &none &kp K_PREV &kp K_PP &kp K_NEXT AS22 AS23
AS24 &m_s_b5 &m_s_b6 &none AS28 AS29 &none &none &none &none &none &none
&kp C_BRI_DN KEY_SPC &to_aBAS &to_aAXN AKY_RET &kp C_BRI_UP
ASLU0 ASLU1 ASLU2 ASLU3 ASLU4 ASLU5 ASRU0 ASRU1 ASRU2 ASRU3 ASRU4 ASRU5
ASLM0 ASLM1 ASLM2 ASLM3 ASLM4 ASLM5 ASRM0 ASRM1 ASRM2 ASRM3 ASRM4 ASRM5
ASLD0 ASLD1 ASLD2 ASLD3 ASLD4 ASLD5 ASRD0 ASRD1 ASRD2 ASRD3 ASRD4 ASRD5
ASLT2 ASLT1 ASLT0 ASRT0 ASRT1 ASRT2
>;
};

2 changes: 1 addition & 1 deletion config/os/macos/keymap.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
#define MSLM4 &hm_mSTG_LS LSHFT 0 // tap: mp_mSTG_screenshot
#define MSLM5 &mp_ma_zoom_reset // tap: zoom reset | shift: zoom reset on vscode

#define MSLD0 &bt BT_CLR
#define MSLD0 &mp_sSTG_cb // tap: none | shift: clear current profile | alt: clear all profiles
#define MSLD1 &m_s_b5
#define MSLD2 &m_s_b6
#define MSLD3 &none
Expand Down
10 changes: 5 additions & 5 deletions config/os/macos/layers.dtsi
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* macOs */
#define mBAS 5
#define mDEV 6
#define mAXN 7
#define mFNK 8
#define mSTG 9
#define mBAS 0
#define mDEV 1
#define mAXN 2
#define mFNK 3
#define mSTG 4

/* Helpers */
#define H_mCWR F13
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TO_MACRO(w, BAS) //to_wBAS
TO_MACRO(m, BAS) //to_mBAS
TO_MACRO(w, BAS) //to_wBAS
TO_MACRO(a, BAS) //to_aBAS
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@ m_s_b1: macro_stg_bluetooth_1 {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings =
<&bt BT_SEL 0 &to_wBAS>;
<&bt BT_SEL 0 &to_mBAS>;
};

m_s_b2: macro_stg_bluetooth_2 {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings =
<&bt BT_SEL 1 &to_wBAS>;
<&bt BT_SEL 1 &to_mBAS>;
};

m_s_b3: macro_stg_bluetooth_3 {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings =
<&bt BT_SEL 2 &to_mBAS>;
<&bt BT_SEL 2 &to_wBAS>;
};

m_s_b4: macro_stg_bluetooth_4 {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings =
<&bt BT_SEL 3 &to_mBAS>;
<&bt BT_SEL 3 &to_wBAS>;
};

m_s_b5: macro_stg_bluetooth_5 {
Expand All @@ -39,3 +39,15 @@ m_s_b6: macro_stg_bluetooth_6 {
bindings =
<&bt BT_SEL 5 &to_aBAS>;
};

// mp_sSTG_cb
MORPH_KAS(
s,
STG,
cb,
clear_bluetooth,
MOD_LALT,
&none,
&bt BT_CLR, // alt: clear current profile
&bt BT_CLR_ALL // shift: clear all profiles
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion config/os/windows/keymap.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
#define WS10 &kp LG(LS(GRAVE)) // tap: fancy zones
#define WS11 &kp LC(LS(ESC)) // tap: task manager
#define WS12 &kp LG(SPACE) // tap: input source
#define WS24 &bt BT_CLR // tap: clear Bluetooth
#define WS24 &mp_sSTG_cb // tap: none | shift: clear current profile | alt: clear all profiles

#define WS22 &kp RG(PAUSE_BREAK) // tap: system info
#define WS23 &kp RG(I) // tap: windows settings
Expand Down
10 changes: 5 additions & 5 deletions config/os/windows/layers.dtsi
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* windows */
#define wBAS 0
#define wDEV 1
#define wAXN 2
#define wFNK 3
#define wSTG 4
#define wBAS 5
#define wDEV 6
#define wAXN 7
#define wFNK 8
#define wSTG 9

/* Helpers */
#define H_wCWR F13
Expand Down
4 changes: 2 additions & 2 deletions docs/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ Dedicated to Bluetooth and media controls.

| Label | Action |
| -------------: | ----------------------- |
| <kbd>B#️⃣</kbd> | Jump to #️⃣ device |
| <kbd>B❌</kbd> | Clear current device |
| <kbd>B#️⃣</kbd> | Jump to #️⃣ device |
| <kbd>❌</kbd> | Clear Bluetooth |
| <kbd>🌐</kbd> | Browser |
| <kbd>🎤</kbd> | Assist |
| <kbd>📅</kbd> | Calendar |
Expand Down
2 changes: 1 addition & 1 deletion docs/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Dedicated to Bluetooth and media controls.
| --------------: | -------------------------- | ---------------------------- |
| <kbd>B#️⃣</kbd> | | Jump to #️⃣ device |
| <kbd>⎉</kbd> | | Input Source |
| <kbd>B❌</kbd> | | Clear current device |
| <kbd>❌</kbd> | | Clear Bluetooth |
| <kbd>Z+</kbd> | | Zoom in |
| <kbd>ZR</kbd> | | Zoom reset |
| <kbd>ZR</kbd> | <kbd>⇧</kbd>+<kbd>ZR</kbd> | Zoom reset VSCode |
Expand Down
12 changes: 6 additions & 6 deletions docs/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Dedicated to Bluetooth and media controls.
| --------------: | -------------------------- | ---------------------- |
| <kbd>B#️⃣</kbd> | | Jump to #️⃣ device |
| <kbd>⎉</kbd> | | Input source |
| <kbd>B❌</kbd> | | Clear current device |
| <kbd>❌</kbd> | | Clear Bluetooth |
| <kbd>▣</kbd> | | Print Screen |
| <kbd>⛢</kbd> | | Color Picker |
| <kbd>🖿</kbd> | | File Explorer |
Expand All @@ -196,11 +196,11 @@ Dedicated to Bluetooth and media controls.

#### Media

| Label | Action |
| ------------: | ----------- |
| <kbd>🔊</kbd> | Volume up |
| <kbd>🔇</kbd> | Mute |
| <kbd>🔉</kbd> | Volume down |
| Label | Action |
| ------------: | ------------ |
| <kbd>🔊</kbd> | Volume up |
| <kbd>🔇</kbd> | Mute |
| <kbd>🔉</kbd> | Volume down |
| <kbd>⏮️</kbd> | Prev |
| <kbd>⏯️</kbd> | Play/Pause |
| <kbd>⏭️</kbd> | Next |
Expand Down

0 comments on commit dfeb27c

Please sign in to comment.