diff options
Diffstat (limited to 'users/ishtob/readme.md')
| -rw-r--r-- | users/ishtob/readme.md | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/users/ishtob/readme.md b/users/ishtob/readme.md new file mode 100644 index 000000000..5b7064de9 --- /dev/null +++ b/users/ishtob/readme.md | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | # Ishtob's userspace | ||
| 2 | |||
| 3 | under developement | ||
| 4 | |||
| 5 | # Secret Macros | ||
| 6 | |||
| 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 | ||
| 8 | |||
| 9 | `macros_private.c` will be used if it exsists in the userspace folder during compiling. | ||
| 10 | |||
| 11 | To get started, put the following in rules.mk. this will have the compiler include the macros_private.c file if it exsists. | ||
| 12 | ``` | ||
| 13 | SRC += ishtob.c | ||
| 14 | ifneq ($(wildcard $(USER_PATH)/macros_private.c),"") | ||
| 15 | SRC += macros_private.c | ||
| 16 | endif | ||
| 17 | ifeq ($(strip $(NO_SECRETS)), yes) | ||
| 18 | OPT_DEFS += -DNO_SECRETS | ||
| 19 | endif | ||
| 20 | ``` | ||
| 21 | |||
| 22 | Remember that all macro keycode has to be present in the header file (ishtob.h) to prevent error during compile. | ||
| 23 | |||
| 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: | ||
| 26 | ``` | ||
| 27 | #include "ishtob.h" //replace this with your userspace or keymap | ||
| 28 | #include "quantum.h" | ||
| 29 | |||
| 30 | #pragma message "secret macros included" //debug line to let me know this file is included in the compile | ||
| 31 | |||
| 32 | //this str is for the monthly password rotation per my workplace's security policy | ||
| 33 | char my_str[5] = "stuff"; | ||
| 34 | |||
| 35 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { | ||
| 36 | if (record->event.pressed) { | ||
| 37 | switch(keycode) { | ||
| 38 | //my login macros | ||
| 39 | case P_CITRIX: | ||
| 40 | SEND_STRING("username"SS_TAP(X_TAB)"something"); | ||
| 41 | send_string(my_str); | ||
| 42 | return false; | ||
| 43 | case P_MPASS: | ||
| 44 | SEND_STRING("something"); | ||
| 45 | send_string(my_str); | ||
| 46 | return false; | ||
| 47 | case P_META: | ||
| 48 | SEND_STRING("metausername"); | ||
| 49 | return false; | ||
| 50 | //my work macros for the meta application | ||
| 51 | case O_RTQ6H: | ||
| 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")); | ||
| 53 | return false; | ||
| 54 | case O_AUTODC: | ||
| 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")); | ||
| 56 | return false; | ||
| 57 | case O_DAYRN: | ||
| 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")); | ||
| 59 | return false; | ||
| 60 | //Ops macros | ||
| 61 | case M_EMAIL: | ||
| 62 | SEND_STRING("privatemail@email.com"); | ||
| 63 | return false; | ||
| 64 | case M_EMAIL2: | ||
| 65 | SEND_STRING("workemail@work.com"); | ||
| 66 | return false; | ||
| 67 | } | ||
| 68 | } | ||
| 69 | return true; | ||
| 70 | } | ||
| 71 | ``` | ||
| 72 | |||
| 73 | |||
| 74 | Finally, add the following to .git/info/exclude to prevent private macros from being committed to git. | ||
| 75 | ``` | ||
| 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): | ||
| 80 | # *.[oa] | ||
| 81 | # *~ | ||
| 82 | /users/ishtob/macros_private.c | ||
| 83 | ``` | ||
| 84 | |||
| 85 | # Special mentions | ||
| 86 | |||
| 87 | special thanks to @drashna for helping me through quite a bit of these codes. \ No newline at end of file | ||
