7 This section is a modified version of what @drashna did in his userspace: https://github.com/qmk/qmk_firmware/tree/master/users/drashna#secret-macros
9 `macros_private.c` will be used if it exsists in the userspace folder during compiling.
11 To get started, put the following in rules.mk. this will have the compiler include the macros_private.c file if it exsists.
14 ifneq ($(wildcard $(USER_PATH)/macros_private.c),"")
15 SRC += macros_private.c
17 ifeq ($(strip $(NO_SECRETS)), yes)
18 OPT_DEFS += -DNO_SECRETS
22 Remember that all macro keycode has to be present in the header file (ishtob.h) to prevent error during compile.
24 Next, you setup macros_private.c, ensure the keycodes are defined in ishtob.h (or your keymap.h).
25 Here is an example of my macros with the sensitive login information removed:
27 #include "ishtob.h" //replace this with your userspace or keymap
30 #pragma message "secret macros included" //debug line to let me know this file is included in the compile
32 //this str is for the monthly password rotation per my workplace's security policy
33 char my_str[5] = "stuff";
35 bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
36 if (record->event.pressed) {
40 SEND_STRING("username"SS_TAP(X_TAB)"something");
44 SEND_STRING("something");
48 SEND_STRING("metausername");
50 //my work macros for the meta application
52 SEND_STRING(SS_TAP(X_TAB)"0300"SS_TAP(X_TAB)SS_TAP(X_DOWN)SS_TAP(X_TAB)"0900"SS_TAP(X_TAB)SS_TAP(X_DOWN)SS_TAP(X_TAB)"1500"SS_TAP(X_TAB)SS_TAP(X_DOWN)SS_TAP(X_TAB)"2100"SS_TAP(X_TAB)SS_LALT("o"));
55 SEND_STRING(SS_LALT("v")SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)"T"SS_TAP(X_TAB)"N"SS_LALT("s"));
58 SEND_STRING(SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)"1"SS_LALT("s"));
62 SEND_STRING("privatemail@email.com");
65 SEND_STRING("workemail@work.com");
74 Finally, add the following to .git/info/exclude to prevent private macros from being committed to git.
76 # git ls-files --others --exclude-from=.git/info/exclude
77 # Lines that start with '#' are comments.
78 # For a project mostly in C, the following would be a good set of
79 # exclude patterns (uncomment them if you want to use them):
82 /users/ishtob/macros_private.c
87 special thanks to @drashna for helping me through quite a bit of these codes.