karabiner.json 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. {
  2. "global": {
  3. "check_for_updates_on_startup": true,
  4. "show_in_menu_bar": false,
  5. "show_profile_name_in_menu_bar": false
  6. },
  7. "profiles": [
  8. {
  9. "complex_modifications": {
  10. "parameters": {
  11. "basic.simultaneous_threshold_milliseconds": 50,
  12. "basic.to_delayed_action_delay_milliseconds": 400,
  13. "basic.to_if_alone_timeout_milliseconds": 1000,
  14. "basic.to_if_held_down_threshold_milliseconds": 500,
  15. "mouse_motion_to_scroll.speed": 100
  16. },
  17. "rules": [
  18. {
  19. "NOTE": "from key must be a JSON object NOT arrary",
  20. "NOTE2": "see README to obtain bundle identifer",
  21. "description": "ipatch, messages.app, cmd+j cmd+k, for next and prev conversation",
  22. "manipulators": [
  23. {
  24. "conditions": [
  25. {
  26. "bundle_identifiers": [
  27. "com.apple.iChat"
  28. ],
  29. "file_paths": [
  30. "/Applications/Messages.app/Contents/MacOS/Messages"
  31. ],
  32. "type": "frontmost_application_if"
  33. }
  34. ],
  35. "from": {
  36. "key_code": "j",
  37. "modifiers": {
  38. "mandatory": [
  39. "left_command"
  40. ]
  41. }
  42. },
  43. "to": [
  44. {
  45. "key_code": "tab",
  46. "modifiers": [
  47. "left_control"
  48. ]
  49. }
  50. ],
  51. "type": "basic"
  52. },
  53. {
  54. "conditions": [
  55. {
  56. "bundle_identifiers": [
  57. "com.apple.iChat"
  58. ],
  59. "file_paths": [
  60. "/Applications/Messages.app/Contents/MacOS/Messages"
  61. ],
  62. "type": "frontmost_application_if"
  63. }
  64. ],
  65. "from": {
  66. "key_code": "k",
  67. "modifiers": {
  68. "mandatory": [
  69. "left_command"
  70. ]
  71. }
  72. },
  73. "to": [
  74. {
  75. "key_code": "tab",
  76. "modifiers": [
  77. "left_control",
  78. "shift"
  79. ]
  80. }
  81. ],
  82. "type": "basic"
  83. }
  84. ]
  85. },
  86. {
  87. "description": "Change caps_lock to control if pressed with other keys, to escape if pressed alone.",
  88. "manipulators": [
  89. {
  90. "from": {
  91. "key_code": "caps_lock",
  92. "modifiers": {
  93. "optional": [
  94. "any"
  95. ]
  96. }
  97. },
  98. "to": [
  99. {
  100. "key_code": "left_control"
  101. }
  102. ],
  103. "to_if_alone": [
  104. {
  105. "key_code": "escape"
  106. }
  107. ],
  108. "type": "basic"
  109. }
  110. ]
  111. },
  112. {
  113. "description": "Toggle caps_lock by pressing left_shift + right_shift at the same time",
  114. "manipulators": [
  115. {
  116. "from": {
  117. "key_code": "left_shift",
  118. "modifiers": {
  119. "mandatory": [
  120. "right_shift"
  121. ],
  122. "optional": [
  123. "caps_lock"
  124. ]
  125. }
  126. },
  127. "to": [
  128. {
  129. "key_code": "caps_lock"
  130. }
  131. ],
  132. "to_if_alone": [
  133. {
  134. "key_code": "left_shift"
  135. }
  136. ],
  137. "type": "basic"
  138. },
  139. {
  140. "from": {
  141. "key_code": "right_shift",
  142. "modifiers": {
  143. "mandatory": [
  144. "left_shift"
  145. ],
  146. "optional": [
  147. "caps_lock"
  148. ]
  149. }
  150. },
  151. "to": [
  152. {
  153. "key_code": "caps_lock"
  154. }
  155. ],
  156. "to_if_alone": [
  157. {
  158. "key_code": "right_shift"
  159. }
  160. ],
  161. "type": "basic"
  162. }
  163. ]
  164. },
  165. {
  166. "description": "ipatch, Map fn + number keys to their corresponding consumer keys ie. vol up / vol down",
  167. "manipulators": [
  168. {
  169. "from": {
  170. "key_code": "1",
  171. "modifiers": {
  172. "mandatory": [
  173. "fn"
  174. ],
  175. "optional": [
  176. "any"
  177. ]
  178. }
  179. },
  180. "to": [
  181. {
  182. "consumer_key_code": "display_brightness_decrement",
  183. "repeat": true
  184. }
  185. ],
  186. "type": "basic"
  187. },
  188. {
  189. "from": {
  190. "key_code": "2",
  191. "modifiers": {
  192. "mandatory": [
  193. "fn"
  194. ],
  195. "optional": [
  196. "any"
  197. ]
  198. }
  199. },
  200. "to": [
  201. {
  202. "consumer_key_code": "display_brightness_increment",
  203. "repeat": true
  204. }
  205. ],
  206. "type": "basic"
  207. },
  208. {
  209. "from": {
  210. "key_code": "3",
  211. "modifiers": {
  212. "mandatory": [
  213. "fn"
  214. ],
  215. "optional": [
  216. "any"
  217. ]
  218. }
  219. },
  220. "to": [
  221. {
  222. "key_code": "mission_control",
  223. "repeat": true
  224. }
  225. ],
  226. "type": "basic"
  227. },
  228. {
  229. "from": {
  230. "key_code": "4",
  231. "modifiers": {
  232. "mandatory": [
  233. "fn"
  234. ],
  235. "optional": [
  236. "any"
  237. ]
  238. }
  239. },
  240. "to": [
  241. {
  242. "key_code": "launchpad",
  243. "repeat": true
  244. }
  245. ],
  246. "type": "basic"
  247. },
  248. {
  249. "from": {
  250. "key_code": "5",
  251. "modifiers": {
  252. "mandatory": [
  253. "fn"
  254. ],
  255. "optional": [
  256. "any"
  257. ]
  258. }
  259. },
  260. "to": [
  261. {
  262. "key_code": "illumination_decrement",
  263. "repeat": true
  264. }
  265. ],
  266. "type": "basic"
  267. },
  268. {
  269. "from": {
  270. "key_code": "6",
  271. "modifiers": {
  272. "mandatory": [
  273. "fn"
  274. ],
  275. "optional": [
  276. "any"
  277. ]
  278. }
  279. },
  280. "to": [
  281. {
  282. "key_code": "illumination_increment",
  283. "repeat": true
  284. }
  285. ],
  286. "type": "basic"
  287. },
  288. {
  289. "from": {
  290. "key_code": "7",
  291. "modifiers": {
  292. "mandatory": [
  293. "fn"
  294. ],
  295. "optional": [
  296. "any"
  297. ]
  298. }
  299. },
  300. "to": [
  301. {
  302. "consumer_key_code": "rewind",
  303. "repeat": true
  304. }
  305. ],
  306. "type": "basic"
  307. },
  308. {
  309. "from": {
  310. "key_code": "8",
  311. "modifiers": {
  312. "mandatory": [
  313. "fn"
  314. ],
  315. "optional": [
  316. "any"
  317. ]
  318. }
  319. },
  320. "to": [
  321. {
  322. "consumer_key_code": "play_or_pause",
  323. "repeat": true
  324. }
  325. ],
  326. "type": "basic"
  327. },
  328. {
  329. "from": {
  330. "key_code": "9",
  331. "modifiers": {
  332. "mandatory": [
  333. "fn"
  334. ],
  335. "optional": [
  336. "any"
  337. ]
  338. }
  339. },
  340. "to": [
  341. {
  342. "consumer_key_code": "fast_forward",
  343. "repeat": true
  344. }
  345. ],
  346. "type": "basic"
  347. },
  348. {
  349. "from": {
  350. "key_code": "0",
  351. "modifiers": {
  352. "mandatory": [
  353. "fn"
  354. ],
  355. "optional": [
  356. "any"
  357. ]
  358. }
  359. },
  360. "to": [
  361. {
  362. "consumer_key_code": "mute",
  363. "repeat": true
  364. }
  365. ],
  366. "type": "basic"
  367. },
  368. {
  369. "from": {
  370. "key_code": "hyphen",
  371. "modifiers": {
  372. "mandatory": [
  373. "fn"
  374. ],
  375. "optional": [
  376. "any"
  377. ]
  378. }
  379. },
  380. "to": [
  381. {
  382. "consumer_key_code": "volume_decrement",
  383. "repeat": true
  384. }
  385. ],
  386. "type": "basic"
  387. },
  388. {
  389. "from": {
  390. "key_code": "equal_sign",
  391. "modifiers": {
  392. "mandatory": [
  393. "fn"
  394. ],
  395. "optional": [
  396. "any"
  397. ]
  398. }
  399. },
  400. "to": [
  401. {
  402. "consumer_key_code": "volume_increment",
  403. "repeat": true
  404. }
  405. ],
  406. "type": "basic"
  407. }
  408. ]
  409. },
  410. {
  411. "description": "Press right_command twice, toggle AutoRaise 🛸",
  412. "manipulators": [
  413. {
  414. "conditions": [
  415. {
  416. "name": "key pressed",
  417. "type": "variable_if",
  418. "value": 1
  419. }
  420. ],
  421. "from": {
  422. "key_code": "right_command",
  423. "modifiers": {
  424. "optional": [
  425. "any"
  426. ]
  427. }
  428. },
  429. "to": [
  430. {
  431. "shell_command": "/bin/bash ~/.local/bin/auto-raise.sh 2>&1 >/dev/null"
  432. }
  433. ],
  434. "type": "basic"
  435. },
  436. {
  437. "description": "to_delayed_action is set to 400ms in karabiner.json",
  438. "from": {
  439. "key_code": "right_command",
  440. "modifiers": {
  441. "optional": [
  442. "any"
  443. ]
  444. }
  445. },
  446. "to": [
  447. {
  448. "set_variable": {
  449. "name": "key pressed",
  450. "value": 1
  451. }
  452. },
  453. {
  454. "key_code": "right_command"
  455. }
  456. ],
  457. "to_delayed_action": {
  458. "to_if_canceled": [
  459. {
  460. "set_variable": {
  461. "name": "key pressed",
  462. "value": 0
  463. }
  464. }
  465. ],
  466. "to_if_invoked": [
  467. {
  468. "set_variable": {
  469. "name": "key pressed",
  470. "value": 0
  471. }
  472. }
  473. ]
  474. },
  475. "type": "basic"
  476. }
  477. ]
  478. },
  479. {
  480. "description": "🏴‍☠️ ipatch, hold left_shift then press fn to globally play or pause ⏯ mpv",
  481. "manipulators": [
  482. {
  483. "from": {
  484. "key_code": "return_or_enter",
  485. "modifiers": {
  486. "mandatory": [
  487. "left_control"
  488. ],
  489. "optional": [
  490. "caps_lock"
  491. ]
  492. }
  493. },
  494. "to": [
  495. {
  496. "shell_command": "/bin/bash ~/.local/bin/mpv_control_playback.sh > ~/logs/mpv_pb.log 2>&1"
  497. }
  498. ],
  499. "type": "basic"
  500. }
  501. ]
  502. }
  503. ]
  504. },
  505. "devices": [
  506. {
  507. "disable_built_in_keyboard_if_exists": false,
  508. "fn_function_keys": [],
  509. "identifiers": {
  510. "is_keyboard": true,
  511. "is_pointing_device": false,
  512. "product_id": 610,
  513. "vendor_id": 1452
  514. },
  515. "ignore": false,
  516. "manipulate_caps_lock_led": true,
  517. "simple_modifications": []
  518. },
  519. {
  520. "disable_built_in_keyboard_if_exists": false,
  521. "fn_function_keys": [],
  522. "identifiers": {
  523. "is_keyboard": true,
  524. "is_pointing_device": false,
  525. "product_id": 591,
  526. "vendor_id": 1452
  527. },
  528. "ignore": false,
  529. "manipulate_caps_lock_led": true,
  530. "simple_modifications": [
  531. {
  532. "from": {
  533. "key_code": "escape"
  534. },
  535. "to": [
  536. {
  537. "key_code": "grave_accent_and_tilde"
  538. }
  539. ]
  540. },
  541. {
  542. "from": {
  543. "key_code": "left_control"
  544. },
  545. "to": [
  546. {
  547. "key_code": "fn"
  548. }
  549. ]
  550. }
  551. ]
  552. }
  553. ],
  554. "fn_function_keys": [
  555. {
  556. "from": {
  557. "key_code": "f1"
  558. },
  559. "to": [
  560. {
  561. "consumer_key_code": "display_brightness_decrement"
  562. }
  563. ]
  564. },
  565. {
  566. "from": {
  567. "key_code": "f2"
  568. },
  569. "to": [
  570. {
  571. "consumer_key_code": "display_brightness_increment"
  572. }
  573. ]
  574. },
  575. {
  576. "from": {
  577. "key_code": "f3"
  578. },
  579. "to": [
  580. {
  581. "key_code": "mission_control"
  582. }
  583. ]
  584. },
  585. {
  586. "from": {
  587. "key_code": "f4"
  588. },
  589. "to": [
  590. {
  591. "key_code": "launchpad"
  592. }
  593. ]
  594. },
  595. {
  596. "from": {
  597. "key_code": "f5"
  598. },
  599. "to": [
  600. {
  601. "key_code": "illumination_decrement"
  602. }
  603. ]
  604. },
  605. {
  606. "from": {
  607. "key_code": "f6"
  608. },
  609. "to": [
  610. {
  611. "key_code": "illumination_increment"
  612. }
  613. ]
  614. },
  615. {
  616. "from": {
  617. "key_code": "f7"
  618. },
  619. "to": [
  620. {
  621. "consumer_key_code": "rewind"
  622. }
  623. ]
  624. },
  625. {
  626. "from": {
  627. "key_code": "f8"
  628. },
  629. "to": [
  630. {
  631. "consumer_key_code": "play_or_pause"
  632. }
  633. ]
  634. },
  635. {
  636. "from": {
  637. "key_code": "f9"
  638. },
  639. "to": [
  640. {
  641. "consumer_key_code": "fastforward"
  642. }
  643. ]
  644. },
  645. {
  646. "from": {
  647. "key_code": "f10"
  648. },
  649. "to": [
  650. {
  651. "consumer_key_code": "mute"
  652. }
  653. ]
  654. },
  655. {
  656. "from": {
  657. "key_code": "f11"
  658. },
  659. "to": [
  660. {
  661. "consumer_key_code": "volume_decrement"
  662. }
  663. ]
  664. },
  665. {
  666. "from": {
  667. "key_code": "f12"
  668. },
  669. "to": [
  670. {
  671. "consumer_key_code": "volume_increment"
  672. }
  673. ]
  674. }
  675. ],
  676. "name": "capin-macOS",
  677. "parameters": {
  678. "delay_milliseconds_before_open_device": 1000
  679. },
  680. "selected": true,
  681. "simple_modifications": [],
  682. "virtual_hid_keyboard": {
  683. "country_code": 0,
  684. "indicate_sticky_modifier_keys_state": true,
  685. "mouse_key_xy_scale": 100
  686. }
  687. }
  688. ]
  689. }