My keyboard layout C code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

87 lines
4.2 KiB

#include QMK_KEYBOARD_H
#include "config.h"
#include "version.h"
extern void combo_enable(void);
extern void combo_disable(void);
LEADER_EXTERNS();
const PROGMEM char* sticker_base = "https://cdn.christine.website/file/christine-static/stickers/";
const PROGMEM char* sticker_extension = ".png\n";
void send_sticker(const char* name) {
send_string(sticker_base);
send_string(name);
send_string(sticker_extension);
}
void matrix_scan_user(void) {
LEADER_DICTIONARY() {
leading = false;
leader_end();
// Go
SEQ_TWO_KEYS(KC_G, KC_B) { SEND_STRING("go build" SS_TAP(X_ENTER)); }
SEQ_THREE_KEYS(KC_G, KC_B, KC_A) { SEND_STRING("go build ./..." SS_TAP(X_ENTER)); }
SEQ_TWO_KEYS(KC_G, KC_T) { SEND_STRING("go test" SS_TAP(X_ENTER)); }
SEQ_THREE_KEYS(KC_G, KC_T, KC_A) { SEND_STRING("go test ./..." SS_TAP(X_ENTER)); }
// Nix
SEQ_THREE_KEYS(KC_N, KC_O, KC_R) { SEND_STRING("sudo nixos-rebuild switch"); }
SEQ_THREE_KEYS(KC_N, KC_O, KC_U) { SEND_STRING("sudo nixos-rebuild switch --upgrade"); }
// Git
SEQ_TWO_KEYS(KC_G, KC_P) { SEND_STRING("git push "); }
SEQ_THREE_KEYS(KC_G, KC_F, KC_P) { SEND_STRING("git push --force-with-lease"); }
SEQ_TWO_KEYS(KC_G, KC_U) { SEND_STRING("git pull "); }
SEQ_TWO_KEYS(KC_G, KC_A) { SEND_STRING("git add ."); }
SEQ_TWO_KEYS(KC_G, KC_D) { SEND_STRING("git diff "); }
SEQ_THREE_KEYS(KC_G, KC_D, KC_S) { SEND_STRING("git diff --staged "); }
SEQ_TWO_KEYS(KC_G, KC_L) { SEND_STRING("git log "); }
SEQ_THREE_KEYS(KC_G, KC_L, KC_O) { SEND_STRING("git log --oneline "); }
SEQ_TWO_KEYS(KC_G, KC_O) { SEND_STRING("git checkout "); }
SEQ_THREE_KEYS(KC_G, KC_O, KC_B) { SEND_STRING("git checkout -b "); }
SEQ_TWO_KEYS(KC_G, KC_S) { SEND_STRING("git status "); }
SEQ_TWO_KEYS(KC_G, KC_C) { SEND_STRING("git commit "); }
SEQ_THREE_KEYS(KC_G, KC_C, KC_S) { SEND_STRING("git commit -sm ''" SS_TAP(X_LEFT)); }
SEQ_THREE_KEYS(KC_G, KC_C, KC_A) { SEND_STRING("git commit --amend -m ''" SS_TAP(X_LEFT)); }
// emacs
SEQ_TWO_KEYS(KC_E, KC_X) { SEND_STRING(SS_LALT(SS_TAP(X_X))); }
// copypastas
SEQ_THREE_KEYS(KC_P, KC_N, KC_B) {
SEND_STRING("Non-binary gender identity is just one term used to describe individuals who may experience a gender identity that is neither exclusively male or female or is in between or beyond both genders. Non-binary individuals may identify as gender fluid, agender (without gender), third gender, or something else entirely. For more information see https://nonbinary.wiki/wiki/Frequently_Asked_Questions.");
}
SEQ_THREE_KEYS(KC_P, KC_B, KC_M) {
SEND_STRING("this sentence makes you breathe manually");
}
// systemctl
SEQ_TWO_KEYS(KC_S, KC_R) { SEND_STRING("systemctl restart "); }
SEQ_THREE_KEYS(KC_S, KC_U, KC_R) { SEND_STRING("systemctl --user restart "); }
SEQ_TWO_KEYS(KC_S, KC_S) { SEND_STRING("systemctl stop "); }
SEQ_THREE_KEYS(KC_S, KC_U, KC_S) { SEND_STRING("systemctl --user stop "); }
SEQ_TWO_KEYS(KC_S, KC_K) { SEND_STRING("systemctl kill "); }
SEQ_THREE_KEYS(KC_S, KC_U, KC_K) { SEND_STRING("systemctl --user kill "); }
// Mara stickers
SEQ_TWO_KEYS(KC_M, KC_H) { send_sticker("mara/hacker"); }
SEQ_TWO_KEYS(KC_M, KC_W) { send_sticker("mara/wat"); }
SEQ_TWO_KEYS(KC_M, KC_T) { send_sticker("mara/hmm"); }
SEQ_TWO_KEYS(KC_M, KC_S) { send_sticker("mara/sh0rck"); }
SEQ_TWO_KEYS(KC_M, KC_A) { send_sticker("mara/aha"); }
SEQ_TWO_KEYS(KC_M, KC_P) { send_sticker("mara/happy"); }
// Cadey stickers
SEQ_TWO_KEYS(KC_C, KC_A) { send_sticker("cadey/aha"); }
SEQ_THREE_KEYS(KC_C, KC_A, KC_N) { send_sticker("cadey/angy"); }
SEQ_TWO_KEYS(KC_C, KC_C) { send_sticker("cadey/coffee"); }
SEQ_THREE_KEYS(KC_C, KC_N, KC_B) { send_sticker("cadey/enby"); }
SEQ_TWO_KEYS(KC_C, KC_F) { send_sticker("cadey/facepalm"); }
SEQ_TWO_KEYS(KC_C, KC_H) { send_sticker("cadey/hug"); }
SEQ_TWO_KEYS(KC_C, KC_P) { send_sticker("cadey/percussive-maintenance"); }
SEQ_TWO_KEYS(KC_C, KC_W) { send_sticker("cadey/wat"); }
}
}