tui-config-schema.json 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "description": "The JSON schema for the Terminal.Gui Configuration Manager (https://gui-cs.github.io/Terminal.Gui/schemas/tui-config-schema.json).",
  4. "type": "object",
  5. "properties": {
  6. "Application.AlternateForwardKey": {
  7. "description": "Alternative key for navigating forwards through views. SCtrl+Tab is the primary key.",
  8. "$ref": "#/definitions/Key"
  9. },
  10. "Application.AlternateBackwardKey": {
  11. "description": "Alternative key for navigating backwards through views. Shift+Ctrl+Tab is the primary key.",
  12. "$ref": "#/definitions/Key"
  13. },
  14. "Application.QuitKey": {
  15. "description": "The key to quit the application. Esc is the default.",
  16. "$ref": "#/definitions/Key"
  17. },
  18. "Application.IsMouseDisabled": {
  19. "description": "Disable or enable the mouse. The mouse is enabled by default.",
  20. "type": "boolean"
  21. },
  22. "Application.UseSystemConsole": {
  23. "description": "If true, forces the use of the System.Console-based (aka NetDriver) driver. The default is false.",
  24. "type": "boolean"
  25. },
  26. "Theme": {
  27. "description": "The currently selected theme. The default is 'Default'.",
  28. "type": "string"
  29. },
  30. "Themes": {
  31. "description": "An array of Theme objects. Each Theme specifies a set of settings for an application. Set Theme to the name of the active theme.",
  32. "type": "array",
  33. "properties": {
  34. "Themes": {
  35. "$ref": "#/definitions/Theme"
  36. }
  37. },
  38. "additionalProperties": {
  39. "$ref": "#/definitions/ColorScheme"
  40. }
  41. }
  42. },
  43. "definitions": {
  44. "Theme": {
  45. "description": "A Theme is a collection of settings that are named.",
  46. "type": "object",
  47. "properties": {
  48. "ColorSchemes": {
  49. "description": "The ColorSchemes defined for this Theme.",
  50. "$ref": "#/definitions/ColorSchemes"
  51. }
  52. }
  53. },
  54. "ColorSchemes": {
  55. "description": "A list of ColorSchemes. Each ColorScheme specifies a set of Attributes (Foreground & Background).",
  56. "type": "array",
  57. "properties": {
  58. "TopLevel": {
  59. "$ref": "#/definitions/ColorScheme"
  60. },
  61. "Base": {
  62. "$ref": "#/definitions/ColorScheme"
  63. },
  64. "Dialog": {
  65. "$ref": "#/definitions/ColorScheme"
  66. },
  67. "Menu": {
  68. "$ref": "#/definitions/ColorScheme"
  69. },
  70. "Error": {
  71. "$ref": "#/definitions/ColorScheme"
  72. }
  73. },
  74. "additionalProperties": {
  75. "$ref": "#/definitions/ColorScheme"
  76. }
  77. },
  78. "ColorScheme": {
  79. "description": "A Terminal.Gui ColorScheme. Specifies the Foreground & Background colors for modes of an Terminal.Gui app.",
  80. "type": "object",
  81. "properties": {
  82. "Normal": {
  83. "description": "The foreground and background color for text when the view is not focused, hot, or disabled.",
  84. "$ref": "#/definitions/Attribute"
  85. },
  86. "Focus": {
  87. "description": "The foreground and background color for text when the view has focus.",
  88. "$ref": "#/definitions/Attribute"
  89. },
  90. "HotNormal": {
  91. "description": "The foreground and background color for text when the view is highlighted (hot).",
  92. "$ref": "#/definitions/Attribute"
  93. },
  94. "HotFocus": {
  95. "description": "The foreground and background color for text when the view is highlighted (hot) and has focus.",
  96. "$ref": "#/definitions/Attribute"
  97. },
  98. "Disabled": {
  99. "description": "The foreground and background color for text when the view disabled.",
  100. "$ref": "#/definitions/Attribute"
  101. }
  102. }
  103. },
  104. "Attribute": {
  105. "description": "A Terminal.Gui color attribute. Specifies the Foreground & Background colors for Terminal.Gui output.",
  106. "type": "object",
  107. "properties": {
  108. "Foreground": {
  109. "$ref": "#/definitions/Color"
  110. },
  111. "Background": {
  112. "$ref": "#/definitions/Color"
  113. }
  114. },
  115. "required": [
  116. "Foreground",
  117. "Background"
  118. ]
  119. },
  120. "Color": {
  121. "description": "One be either one of 16 standard color names or an rgb(r,g,b) tuple.",
  122. "$schema": "http://json-schema.org/draft-07/schema#",
  123. "type": "string",
  124. "properties": {
  125. "color": {
  126. "oneOf": [
  127. {
  128. "type": "string",
  129. "enum": [
  130. "Black",
  131. "Blue",
  132. "Green",
  133. "Cyan",
  134. "Red",
  135. "Magenta",
  136. "Brown",
  137. "Gray",
  138. "DarkGray",
  139. "BrightBlue",
  140. "BrightGreen",
  141. "BrightCyan",
  142. "BrightRed",
  143. "BrightMagenta",
  144. "BrightYellow",
  145. "White"
  146. ]
  147. },
  148. {
  149. "type": "string",
  150. "pattern": "^rgb\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)$"
  151. }
  152. ]
  153. }
  154. }
  155. },
  156. "Key": {
  157. "description": "A key pressed on the keyboard.",
  158. "type": "object",
  159. "properties": {
  160. "Key": {
  161. "description": "A key name (e.g. A, b, 1, 2, Enter, Esc, F5, etc.) or an integer value (e.g. 65, 66, 67, etc.).",
  162. "oneOf": [
  163. {
  164. "type": "string",
  165. "enum": [
  166. "Null",
  167. "Backspace",
  168. "Tab",
  169. "Enter",
  170. "Clear",
  171. "Esc",
  172. "Space",
  173. "D0",
  174. "D1",
  175. "D2",
  176. "D3",
  177. "D4",
  178. "D5",
  179. "D6",
  180. "D7",
  181. "D8",
  182. "D9",
  183. "0",
  184. "1",
  185. "2",
  186. "3",
  187. "4",
  188. "5",
  189. "6",
  190. "7",
  191. "8",
  192. "9",
  193. "a",
  194. "b",
  195. "c",
  196. "d",
  197. "e",
  198. "f",
  199. "g",
  200. "h",
  201. "i",
  202. "j",
  203. "k",
  204. "l",
  205. "m",
  206. "n",
  207. "o",
  208. "p",
  209. "q",
  210. "r",
  211. "s",
  212. "t",
  213. "u",
  214. "v",
  215. "w",
  216. "x",
  217. "y",
  218. "z",
  219. "A",
  220. "B",
  221. "C",
  222. "D",
  223. "E",
  224. "F",
  225. "G",
  226. "H",
  227. "I",
  228. "J",
  229. "K",
  230. "L",
  231. "M",
  232. "N",
  233. "O",
  234. "P",
  235. "Q",
  236. "R",
  237. "S",
  238. "T",
  239. "U",
  240. "V",
  241. "W",
  242. "X",
  243. "Y",
  244. "Z",
  245. "F1",
  246. "F2",
  247. "F3",
  248. "F4",
  249. "F5",
  250. "F6",
  251. "F7",
  252. "F8",
  253. "F9",
  254. "F10",
  255. "F11",
  256. "F12",
  257. "Insert",
  258. "Delete",
  259. "Home",
  260. "End",
  261. "PageUp",
  262. "PageDown",
  263. "Up",
  264. "Down",
  265. "Left",
  266. "Right"
  267. ]
  268. },
  269. {
  270. "type": "integer"
  271. }
  272. ]
  273. },
  274. "Modifiers": {
  275. "description": "A keyboard modifier (e.g. Ctrl, Alt, or Shift).",
  276. "type": "array",
  277. "items": {
  278. "type": "string",
  279. "enum": [
  280. "Ctrl",
  281. "Alt",
  282. "Shift"
  283. ]
  284. }
  285. }
  286. },
  287. "required": [
  288. "Key"
  289. ]
  290. }
  291. }
  292. }