preset_generator.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #/bin/bash
  2. # {
  3. # "version": 1,
  4. # "keyboard": {
  5. # "keys": [{
  6. # "id": 0,
  7. # "legend": "Tab",
  8. # "state": {
  9. # "x": 0,
  10. # "y": 0,
  11. # "r": 0,
  12. # "rx": 0,
  13. # "ry": 0,
  14. # "w": 1,
  15. # "h": 1,
  16. # "x2": 0,
  17. # "y2": 0,
  18. # "w2": 0,
  19. # "h2": 0,
  20. # "a": 7
  21. # },
  22. # "row": 0,
  23. # "col": 0,
  24. # "keycodes": [{
  25. # "id": "KC_TAB",
  26. # "fields": []
  27. # }]
  28. # }],
  29. # "controller": 1,
  30. # "bounds": {
  31. # "min": {
  32. # "x": 0,
  33. # "y": 0
  34. # },
  35. # "max": {
  36. # "x": 12,
  37. # "y": 4
  38. # }
  39. # },
  40. # "rows": 4,
  41. # "cols": 12,
  42. # "pins": {
  43. # "row": ["D0", "D5", "B5", "B6"],
  44. # "col": ["F1", "F0", "B0", "C7", "F4", "F5", "F6", "F7", "D4", "D6", "B4", "D7"],
  45. # "num": null,
  46. # "caps": null,
  47. # "scroll": null,
  48. # "compose": null,
  49. # "kana": null,
  50. # "led": "B7",
  51. # "rgb": null
  52. # },
  53. # "macros": {},
  54. # "quantum": "void matrix_init_user(void) {\n}\n\nvoid matrix_scan_user(void) {\n}\n\nbool process_record_user(uint16_t keycode, keyrecord_t *record) {\n\treturn true;\n}",
  55. # "settings": {
  56. # "diodeDirection": 0,
  57. # "name": "Planck Default",
  58. # "bootloaderSize": 2,
  59. # "rgbNum": 0,
  60. # "backlightLevels": 3
  61. # }
  62. # }
  63. # }
  64. keyboard=$1
  65. subproject=$2
  66. keymap=$(gcc -fpreprocessed -dD -E keyboards/$keyboard/default/keymap.c)
  67. printf '{
  68. "version": 1,
  69. "keyboard": {