├── .clj-kondo └── .cache │ └── v1 │ └── lock ├── README.md └── karabiner.edn /.clj-kondo/.cache/v1/lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # What is this for? 2 | 3 | This is a configuration file for [GokuRakuJoudo](#what-are-karabiner-and-gokurakujoudo) which in turn generates a [Karabiner](#what-are-karabiner-and-gokurakujoudo) profile. 4 | 5 | Some things rely upon the fact that the Colemak layout (and its corresponding layer) is used. Single press mod keys are used as "power key combos" and a trigger things like toggling reader mode in Safari, switching between editor and terminal in VSCode or sending the tmux prefix in [Kitty](https://sw.kovidgoyal.net/kitty/index.html), the fast, lightweight, terminal emulator. 6 | 7 | ## What are Karabiner and GokuRakuJoudo? 8 | 9 | [Karabiner](https://pqrs.org/osx/karabiner/) is a powerful and stable keyboard customizer for macOS. [Goku](https://github.com/yqrashawn/GokuRakuJoudo) is a tool to let you manage your Karabiner configuration with ease, since Karabiner uses JSON for its very verbose, complex config file, while Goku uses the "optimized for typing" [edn format](https://github.com/edn-format/edn). 10 | 11 | ## Sample combos 12 | 13 | - press and release `LCmd` to switch to previously used app 14 | - press and release `RCmd` and, depending on the current app get this: 15 | - toggle between terminal and editor in VSCode 16 | - toggle reading mode in Safari 17 | - send tmux prefix in Kitty 18 | - toggle left pane with notes list in Drafts 19 | - press and release `ROpt` and, depending on the current app get this: 20 | - toggle between left and right editors in split-screen VSCode 21 | - toggle tab overview in Safari 22 | - etc 23 | - get an extended layer on pressing and holding the space bar 24 | - etc 25 | 26 | **Special mention**: there is an `experimental` branch where some settings are active, like sequence layers (press `shift`, quickly followed by `s` to send `S`, or `LCmd` quickly followed by `t` to send `Cmt+T`) or getting 4 different outcomes from a single key. Check it out. 27 | 28 | ## Installation 29 | 30 | 1. Install [Karabiner-Elements](https://pqrs.org/osx/karabiner/) 31 | 2. Create a profile named 'Default' in Karabiner-Elements. (It will generate a karabiner.json file under ~/.config/karabiner/ folder for goku to use.) 32 | 3. Install [Goku](https://github.com/yqrashawn/GokuRakuJoudo) 33 | 4. Install files from this repo. 34 | 35 | ```shell 36 | # curl https://raw.githubusercontent.com/kiinoda/goku/master/karabiner.edn > ~/.config/karabiner.edn 37 | # goku 38 | ``` 39 | 40 | ### Inspiration 41 | 42 | Various parts were adapted from other internet sources, indicated below. 43 | 44 | - [Kun Chen - k-goku](https://github.com/kchen0x/k-goku) - document structure and general inspiration 45 | - [John Lindquist - dotfiles](https://github.com/johnlindquist/dotfiles) - emoji layer contents and from/to templates needed to "translate" between QWERTY and Colemak 46 | - [Nikita Voloboev - dotfiles](https://github.com/nikitavoloboev/dotfiles) - general inspiration, properly using conditions in rules 47 | - [Xah Lee - Banning the Shift Key](http://xahlee.info/kbd/banish_shift_key.html) - the seed for the sequence layers 48 | - [Øystein Bech Gadmar - Colemak Forum - Extend Layer](https://forum.colemak.com/topic/2014-extend-extra-extreme/) - the general organization of the extend layer 49 | 50 | 57 | -------------------------------------------------------------------------------- /karabiner.edn: -------------------------------------------------------------------------------- 1 | { 2 | :profiles { 3 | :goku { 4 | :default true 5 | :sim 200 ; keys need to be pressed within this threshold to be considered simultaneous 6 | :simlayer-threshold 250 ; ??????? 7 | :alone 250 ; hold for 495ms and single tap registered; hold for 505ms and seen as modifier 8 | :delay 300 ; time after which the key press is count delayed 9 | :held 450 ; key is fired twice when 1000 ms is elapsed (otherwise seen as a hold command) 10 | } 11 | } 12 | 13 | :devices { 14 | :kninepro [{:vendor_id 13364 :product_id 656}] 15 | ; :kninepro [{:vendor_id 13364 :product_id 640}] 16 | } 17 | 18 | :templates { 19 | :open_social "/Users/kii/bin/open_social %s" 20 | :open "osascript -e 'tell application \"%s\" to activate'" 21 | :showhide "osascript -e ' 22 | global isVisible 23 | set isVisible to visible of process \"%s\" 24 | set isVisible to not isVisible 25 | set visible of process \"%s\" to isVisible 26 | '" 27 | :go_to_url "osascript -e 'open location \"%s\"'" 28 | ; send keystrokes 29 | :type "osascript -e 'tell application \"System Events\" to keystroke \"%s\"'" 30 | ; send keystrokes and press enter 31 | :type_cr " 32 | osascript -e 'tell application \"System Events\" to keystroke \"%s\"'; 33 | osascript -e 'tell application \"System Events\" to keystroke return';" 34 | :paste "osascript -e ' 35 | global storedClipboard 36 | set storedClipboard to the clipboard 37 | set the clipboard to \"%s\" 38 | set the clipboard to the clipboard + \"%s\" 39 | tell application \"System Events\" 40 | keystroke \"v\" using command down 41 | end tell 42 | delay 0.1 43 | set the clipboard to storedClipboard 44 | '" 45 | :is_in_gdoc "osascript -e ' 46 | global frontApp, window_name, theURL 47 | tell application \"System Events\" 48 | set frontApp to name of first application process whose frontmost is true 49 | end tell 50 | if frontApp equals \"Safari\" then 51 | tell application \"Safari\" 52 | set theURL to URL of current tab of window 1 53 | end tell 54 | if theURL contains \"https://docs.google.com/spreadsheets\" then 55 | do shell script \"/Users/kii/bin/in-gdoc.sh\" 56 | end if 57 | end if'" 58 | :sleep "sleep %s" ; sample placeholder 59 | } 60 | 61 | :applications { 62 | ; extract from /Applications/$APP/Contents/Info.plist from 'CFBundleIdentifier' key 63 | :arc [ "^company.thebrowser.Browser" ] 64 | :chrome [ "^com.google.Chrome$" ] 65 | :discord [ "^com.hnc.Discord" ] 66 | :drafts [ "^com.agiletortoise.Drafts-OSX$" ] 67 | :emacs [ "^org.gnu.Emacs$" ] 68 | :evernote [ "^com.evernote.Evernote$" ] 69 | :finder [ "^com.apple.finder" ] 70 | :firefox [ "^org.mozilla.firefox$" ] 71 | :ghostty [ "^com.mitchellh.ghostty$" ] 72 | :goodnotes [ "^com.goodnotesapp.x$" ] 73 | :kitty [ "net.kovidgoyal.kitty" ] 74 | :mailmate [ "^com.freron.MailMate$"] 75 | :min [ "^com.electron.min$"] 76 | :messages [ "^com.apple.MobileSMS" ] 77 | :obsidian [ "^md.obsidian" ] 78 | :opera [ "^com.operasoftware.Opera$" ] 79 | :safari [ "^com.apple.Safari$" ] 80 | :slack [ "^com.tinyspeck.slackmacgap" ] 81 | :stickies [ "^com.apple.Stickies" ] 82 | :teams [ "^com.microsoft.teams" ] 83 | :telegram [ "^ru.keepcoder.Telegram" ] 84 | :vscode [ "^com.microsoft.VSCode$" ] 85 | :vivaldi [ "^com.vivaldi.Vivaldi$" ] 86 | :vlc [ "^org.videolan.vlc" ] 87 | :workflowy [ "^com.workflowy.desktop" ] 88 | :zoom [ "^us.zoom.xos$" ] 89 | } 90 | 91 | :froms { 92 | :any_key {:any :key_code} 93 | :any_consumer {:any :consumer_key_code } 94 | :any_button {:any :pointing_button} 95 | 96 | ;alias 97 | :delete {:key :delete_or_backspace} 98 | :return {:key :return_or_enter} 99 | :btick {:key :grave_accent_and_tilde} 100 | :tilde {:key :grave_accent_and_tilde} 101 | :bslash {:key :backslash} 102 | :ls {:key :left_shift} 103 | :rs {:key :right_shift} 104 | 105 | ;colemak froms (for easier mnemonics) 106 | :-q {:key :q} 107 | :-w {:key :w} 108 | :-f {:key :e} 109 | :-p {:key :r} 110 | :-g {:key :t} 111 | :-j {:key :y} 112 | :-l {:key :u} 113 | :-u {:key :i} 114 | :-y {:key :o} 115 | :-semicolon {:key :p} 116 | 117 | :-a {:key :a} 118 | :-r {:key :s} 119 | :-s {:key :d} 120 | :-t {:key :f} 121 | :-d {:key :g} 122 | :-h {:key :h} 123 | :-n {:key :j} 124 | :-e {:key :k} 125 | :-i {:key :l} 126 | :-o {:key :semicolon} 127 | 128 | :-z {:key :grave_accent_and_tilde} 129 | :-x {:key :z} 130 | :-c {:key :x} 131 | :-v {:key :c} 132 | :-b {:key :v} 133 | :-k {:key :n} 134 | :-m {:key :m} 135 | } 136 | 137 | :tos { 138 | ;colemak tos (for easier string sending) 139 | :-q {:key :q} 140 | :-w {:key :w} 141 | :-f {:key :e} 142 | :-p {:key :r} 143 | :-g {:key :t} 144 | :-j {:key :y} 145 | :-l {:key :u} 146 | :-u {:key :i} 147 | :-y {:key :o} 148 | :-semicolon {:key :semicolon} 149 | 150 | :-a {:key :a} 151 | :-r {:key :s} 152 | :-s {:key :d} 153 | :-t {:key :f} 154 | :-d {:key :g} 155 | :-h {:key :h} 156 | :-n {:key :j} 157 | :-e {:key :k} 158 | :-i {:key :l} 159 | :-o {:key :semicolon} 160 | 161 | :-z {:key :grave_accent_and_tilde} 162 | :-x {:key :z} 163 | :-c {:key :x} 164 | :-v {:key :c} 165 | :-b {:key :v} 166 | :-k {:key :n} 167 | :-m {:key :m} 168 | 169 | ;named symbols 170 | :exclaim {:key :1 :modi :shift} 171 | :at {:key :2 :modi :shift} 172 | :hash {:key :3 :modi :shift} 173 | :dollar {:key :4 :modi :shift} 174 | :percent {:key :5 :modi :shift} 175 | :caret {:key :6 :modi :shift} 176 | :ampersand {:key :7 :modi :shift} 177 | :bullet {:key :8 :modi :shift} 178 | :open_paren {:key :9 :modi :shift} 179 | :close_paren {:key :0 :modi :shift} 180 | :hyphen {:key :hyphen} 181 | :underscore {:key :hyphen :modi :shift} 182 | :equal {:key :equal_sign} 183 | :plus {:key :equal_sign :modi :shift} 184 | :semicolon {:key :semicolon} 185 | :colon {:key :semicolon :modi :shift} 186 | :open_bracket {:key :open_bracket} 187 | :close_bracket {:key :close_bracket} 188 | :open_brace {:key :open_bracket :modi :shift} 189 | :close_brace {:key :close_bracket :modi :shift} 190 | :less_than {:key :comma :modi :shift} 191 | :greater_than {:key :period :modi :shift} 192 | :backquote {:key :grave_accent_and_tilde} 193 | :tilde {:key :grave_accent_and_tilde :modi :shift} 194 | :dquote {:key :quote :modi :shift} 195 | :pipe {:key :backslash :modi :shift} 196 | :question {:key :slash :modi :shift} 197 | :ls {:key :left_shift} 198 | :rs {:key :right_shift} 199 | 200 | ; system-wide shortcuts 201 | :command_tab {:key :!Ctab} 202 | :left_desktop {:key :!!left_arrow} 203 | :right_desktop {:key :!!right_arrow} 204 | :mission_control {:key :!!up_arrow} 205 | :internet_query {:key :!!t} 206 | :show_application_windows {:key :!!down_arrow} 207 | :show_desktop {:key :f12} 208 | :activate_spotlight {:key :!!spacebar} 209 | :fullscreen_snapshot {:key :!CS3} 210 | :window_snapshot {:key :!CS4} 211 | :selection_snapshot {:key :!CS5} 212 | :emoji_picker {:key :spacebar :modi [:control :command]} ;!CTspacebar 213 | :system-new_tab {:key :!Ct} 214 | :system-close_tab {:key :!Cw} 215 | :system-force_quit_apps {:key :!COescape} 216 | 217 | ; 1password 218 | :activate_1password {:key :!COTspacebar} 219 | ; chrome 220 | :chrome-prev_tab {:key :!TStab} 221 | :chrome-next_tab {:key :!Ttab} 222 | :chrome-toggle_reader {:key :!CSr} 223 | ; drafts 224 | :drafts-toggle_onoff {:key :!!return_or_enter} 225 | :drafts-beginning_of_line {:key :!Cleft_arrow} 226 | :drafts-end_of_line {:key :!Cright_arrow} 227 | :drafts-toggle_draft_list {:key :!C1} 228 | ; emacs 229 | ; evernote 230 | :evernote-beginning_of_line {:key :!Cleft_arrow} 231 | :evernote-end_of_line {:key :!Cright_arrow} 232 | ; hazeover - focus on one window 233 | :activate_hazeover {:key :!!f6} 234 | ; kitty 235 | :kitty-prev_tab {:key :!Cleft_arrow} 236 | :kitty-next_tab {:key :!Cright_arrow} 237 | :kitty-move_tab_left {:key :!COleft_arrow} 238 | :kitty-move_tab_right {:key :!COright_arrow} 239 | :kitty-word_left {:key :!Tleft_arrow} 240 | :kitty-word_right {:key :!Tright_arrow} 241 | :kitty-beginning_of_line {:key :!Ta} 242 | :kitty-end_of_line {:key :!Te} 243 | :kitty-tmux_prefix {:key :!Ta} 244 | ; opera 245 | :opera-prev_tab {:key :!COleft_arrow} 246 | :opera-next_tab {:key :!COright_arrow} 247 | ; rectangle - window positioning 248 | :window_resize_and_left {:key :!!j} 249 | :window_resize_and_right {:key :!!l} 250 | :window_resize_and_center {:key :!!k} 251 | :window_full_size {:key :!!i} 252 | :window_center {:key :!!semicolon} 253 | ; safari 254 | :safari-prev_tab {:key :!TStab} 255 | :safari-next_tab {:key :!Ttab} 256 | :safari-hist_back {:key :!Copen_bracket} 257 | :safari-hist_frwd {:key :!Cclose_bracket} 258 | :safari-toggle_reader {:key :!CSr} 259 | :safari-toggle_darkmode {:key :!COk} 260 | :safari-close_tab {:key :!Cw} 261 | ; vscode 262 | :toggle_terminal_or_editor {:key :!Tgrave_accent_and_tilde} 263 | :toggle_terminal {:key :!COspacebar} 264 | :focus_group_or_terminal_left {:key :!CTOup_arrow} 265 | :focus_group_or_terminal_right {:key :!CTOdown_arrow} 266 | :focus_editor_left {:key :!COleft_arrow} 267 | :focus_editor_right {:key :!COright_arrow} 268 | :focus_file_or_new_tab {:key :!Cp} 269 | } 270 | 271 | ; :simlayers {:apprun {:key :period}} 272 | :main [ 273 | { 274 | :des "Cmd+Option+Shift+Esc to Reset All Layers (when/if something goes horribly wrong)" 275 | :rules [ 276 | [:!COTescape [ 277 | ["blocked" 0]["extend" 0]["apprun" 0]["capslock" 0]["layer" 0] 278 | ]] 279 | ] 280 | } 281 | { 282 | :des "Toggle CapsLock w/ FN+CapsLock" 283 | :rules [ 284 | [:!F#Pcaps_lock [:caps_lock [:noti :caps "Caps Lock"]["capslock" 1]] [["capslock" 0]["blocked" 0]]] 285 | [:!F#Pcaps_lock [:caps_lock [:noti :caps ""]["capslock" 0]] [["capslock" 1]["blocked" 0]]] 286 | ] 287 | } 288 | { 289 | :des "Rotate between Colemak, QWERTY w/ layers and Off w/ FN+LeftShift" 290 | :rules [ 291 | [:!F#Pleft_shift [["blocked" 1]["layer" 1]]["layer" 0]] 292 | [:!F#Pleft_shift [["blocked" 1]["layer" 2]]["layer" 1]] 293 | [:!F#Pleft_shift [["blocked" 0]["layer" 0]]["layer" 2]] 294 | ] 295 | } 296 | { 297 | :des "AppRun Layer - hold Tab key to activate" 298 | :rules [ 299 | [:tab ["apprun" 1] [:!fn_base :!fn_ctrl :!fn_optn :!fn_cmnd :!extend :!blocked] {:alone :tab :afterup ["apprun" 0]}] 300 | :apprun 301 | ;; switch desktops 302 | [:y :!!1] 303 | [:u :!!2] 304 | [:i :!!3] 305 | [:o :!!4] 306 | [:p :!!5] 307 | [:open_bracket :!!6] 308 | ;; swap active browser 309 | [:right_option ["browser" 0] ["browser" 1]] 310 | [:right_option ["browser" 1] ["browser" 0]] 311 | [:spacebar [:open "Safari"] ["browser" 0]] 312 | [:spacebar [:open "Vivaldi"] ["browser" 1]] 313 | [:right_command [:open "Vivaldi"] ["browser" 0]] 314 | [:right_command [:open "Safari"] ["browser" 1]] 315 | ;; swap shift combos between tiled/stacked 316 | [:left_control ["yabai_stack" 0] ["yabai_stack" 1]] 317 | [:left_control ["yabai_stack" 1] ["yabai_stack" 0]] 318 | ;; swap shift combos between tiled/stacked 319 | [:fn ["yabai_stack" 0] ["yabai_stack" 1]] 320 | [:fn ["yabai_stack" 1] ["yabai_stack" 0]] 321 | ;; keys acting on single apps 322 | [:j [:open "Drafts"]] 323 | [:n [:open "Kitty"]] 324 | [:m [:open "Mailmate"]] 325 | ;; final cleanup 326 | [:any_key :vk_none] 327 | [:any_consumer :vk_none] 328 | ] 329 | } 330 | { 331 | :des "Yabai Layers (uses Fn as base trigger)" 332 | :rules [ 333 | [[:left_shift :right_shift] :!Freturn_or_enter] 334 | [:f24 ["fn_base" 1] nil {:afterup ["fn_base" 0] :alone :!Fbackslash}] 335 | [:condi :fn_base :!fn_ctrl :!fn_optn :!fn_cmnd] 336 | [:caps_lock [:caps_lock [:noti :caps "Caps Lock"]["capslock" 1]] [["capslock" 0]["blocked" 0]]] 337 | [:!Pcaps_lock [:caps_lock [:noti :caps ""]["capslock" 0]] [["capslock" 1]["blocked" 0]]] 338 | [:left_shift [["blocked" 1]["layer" 1]]["layer" 0]] 339 | [:left_shift [["blocked" 1]["layer" 2]]["layer" 1]] 340 | [:left_shift [["blocked" 0]["layer" 0]]["layer" 2]] 341 | [:left_control ["fn_ctrl" 1] nil {:afterup ["fn_ctrl" 0]}] 342 | [:left_option ["fn_optn" 1] nil {:afterup ["fn_optn" 0]}] 343 | [:left_command ["fn_cmnd" 1] nil {:afterup ["fn_cmnd" 0]}] 344 | [:condi :fn_base :!fn_ctrl :!fn_optn :!fn_cmnd] 345 | [:right_shift :!Fbackslash] 346 | ; 347 | [:w ["fn_optn" 1] nil {:afterup ["fn_optn" 0]}] 348 | [:e ["fn_cmnd" 1] nil {:afterup ["fn_cmnd" 0]}] 349 | [:1 :!F1] 350 | [:2 :!F2] 351 | [:3 :!F3] 352 | [:7 :!F7] 353 | [:8 :!F8] 354 | [:9 :!F9] 355 | [:0 :!F0] 356 | [:z :!Fz] 357 | [:x :!Fx] 358 | [:c :!Fc] 359 | [:u :!Fu] 360 | [:o :!Fo] 361 | [:i :!Fi] 362 | [:j :!Fj] 363 | [:k :!Fk] 364 | [:l :!Fl] 365 | [:r :!Fr] 366 | [:p :!Fp] 367 | [:f :!Ff] 368 | [:n :!Fm] 369 | [:open_bracket :!Fopen_bracket] 370 | [:close_bracket :!Fclose_bracket] 371 | [:comma :!!left_arrow] 372 | [:period :!!right_arrow] 373 | [:hyphen :!Fhyphen] 374 | [:spacebar :!Fspacebar] 375 | [:tab :!Ftab] 376 | [:equal_sign :!Fequal_sign] 377 | [:hyphen :!Fhyphen] 378 | [:backslash :!Fbackslash] 379 | [:h :!Fbackslash] 380 | [:return_or_enter :!Freturn_or_enter] 381 | [:any_key :vk_none] 382 | [:condi :fn_ctrl] 383 | [:8 :!FT8] 384 | [:9 :!FT9] 385 | [:0 :!FT0] 386 | [:i :!FTi] 387 | [:j :!FTj] 388 | [:k :!FTk] 389 | [:l :!FTl] 390 | [:any_key :vk_none] 391 | [:condi :fn_optn] 392 | [:8 :!FT8] 393 | [:9 :!FT9] 394 | [:0 :!FT0] 395 | [:i :!FOi] 396 | [:j :!FOj] 397 | [:k :!FOk] 398 | [:l :!FOl] 399 | [:comma :!!left_arrow] 400 | [:period :!!right_arrow] 401 | [:any_key :vk_none] 402 | [:condi :fn_cmnd] 403 | [:8 :!FT8] 404 | [:9 :!FT9] 405 | [:0 :!FT0] 406 | [:i :!FCi] 407 | [:j :!FCj] 408 | [:k :!FCk] 409 | [:l :!FCl] 410 | [:any_key :vk_none] 411 | ] 412 | } 413 | { 414 | :des "Kitty Layers" 415 | :rules [ 416 | [:condi :fn_desk] 417 | [:j :!!left_arrow] 418 | [:l :!!right_arrow] 419 | [:any_key :vk_none] 420 | [:condi :fn_tmux] 421 | [:i :!TOup_arrow] 422 | [:j :!TOleft_arrow] 423 | [:k :!TOdown_arrow] 424 | [:l :!TOright_arrow] 425 | [:9 [:!Ta :!S9]] 426 | [:0 [:!Ta :!S0]] 427 | [:any_key :vk_none] 428 | [:condi :fn_nvim] 429 | [:u :!Sb] 430 | [:o :!Sw] 431 | [:semicolon [:!Tw :o]] 432 | [:i [:escape :!Tw :up_arrow]] 433 | [:j [:escape :!Tw :left_arrow]] 434 | [:k [:escape :!Tw :down_arrow]] 435 | [:l [:escape :!Tw :right_arrow]] 436 | [:comma [:type_cr ":bp"]] 437 | [:period [:type_cr ":bn"]] 438 | [:any_key :vk_none] 439 | ] 440 | } 441 | { 442 | :des "Power Combos" 443 | :rules [ 444 | [:condi :!blocked :!extend :!apprun] 445 | [:left_command :left_command nil {:alone :!Fspacebar}] 446 | [:return_or_enter nil nil {:alone :return_or_enter :held :!CTf}] 447 | ; Yabai: switch between apps in the stack OR tiled using shift 448 | [:left_shift :left_shift [["yabai_stack" 0]] {:alone :!Fcomma}] 449 | [:right_shift :right_shift [["yabai_stack" 0]] {:alone :!Fperiod}] 450 | [:!Rleft_shift :!!left_arrow] 451 | [:!Sright_shift :!!right_arrow] 452 | ; [:left_command :left_command nil {:alone :!Ctab}] 453 | ; global 454 | [:##caps_lock :left_control nil {:alone :escape}] 455 | [:f5 :!Fh] ; toggle show desktop 456 | [:f6 :activate_hazeover] ; activate hazeover 457 | [:!Th :delete_or_backspace] 458 | [:!Sspacebar :spacebar] 459 | ; chrome 460 | [:!Qleft_command [:!Ql :!Qv :return_or_enter] :chrome] 461 | [:!Cright_command [:button2 :c :return_or_enter] :chrome] 462 | [:right_command :right_command :chrome {:alone :chrome-toggle_reader}] 463 | ; discord 464 | [:right_command :right_command :discord {:alone :!Cu}] ; toggle user list 465 | ; drafts 466 | [:right_command :right_command :drafts {:alone [:!C1 :!COt :!CSt]}] ; make it look as basic as possible 467 | [:right_option :right_option :drafts {:alone [:!Cbackslash :down_arrow :down_arrow :right_arrow]}] 468 | [:left_option :left_option :drafts {:alone [:!CSbackslash]}] 469 | [:!Cdelete_or_backspace :!CSOdelete_or_backspace :drafts] 470 | ; finder 471 | [:right_command :right_command :finder {:alone :!CTs}] 472 | ; ghostty 473 | [:left_option :left_option :ghostty {:alone [:!Ta :z]}] 474 | [:right_option :right_option [:ghostty :!tmux_sync_panes] {:alone [:!Ta :!Ssemicolon [:type_cr "setw synchronize-panes on"] ["tmux_sync_panes" 1]]}] 475 | [:right_option :right_option [:ghostty :tmux_sync_panes] {:alone [:!Ta :!Ssemicolon [:type_cr "setw synchronize-panes off"] ["tmux_sync_panes" 0]]}] 476 | [:right_command :right_command [:ghostty ["tmux_prefix" 0]] {:alone :!Ta}] 477 | [:right_command :right_command [:ghostty ["tmux_prefix" 1]] {:alone :!Tb}] 478 | ; rotate between ctrl+a & ctrl+b as a tmux prefix 479 | [:!Qspacebar ["tmux_prefix" 1] [:ghostty ["tmux_prefix" 0]]] 480 | [:!Qspacebar ["tmux_prefix" 0] [:ghostty ["tmux_prefix" 1]]] 481 | [:!Cf [:!Ta :c] :ghostty] ; Cmd+T on Colemak 482 | [:!Cw [:!Ta :k] :ghostty] 483 | [:!C0 [:!Ta :0] :ghostty] 484 | [:!C1 [:!Ta :1] :ghostty] 485 | [:!C2 [:!Ta :2] :ghostty] 486 | [:!C3 [:!Ta :3] :ghostty] 487 | [:!C4 [:!Ta :4] :ghostty] 488 | [:!C5 [:!Ta :5] :ghostty] 489 | [:!C6 [:!Ta :6] :ghostty] 490 | [:!C7 [:!Ta :7] :ghostty] 491 | [:!C8 [:!Ta :8] :ghostty] 492 | [:!C9 [:!Ta :9] :ghostty] 493 | [:!CSf :vk_none :ghostty] 494 | [:!Qf :!QSt :ghostty] 495 | [:!Q0 :!C0 :ghostty] 496 | [:!Q1 :!C1 :ghostty] 497 | [:!Q2 :!C2 :ghostty] 498 | [:!Q3 :!C3 :ghostty] 499 | [:!Q4 :!C4 :ghostty] 500 | [:!Q5 :!C5 :ghostty] 501 | [:!Q6 :!C6 :ghostty] 502 | [:!Q7 :!C7 :ghostty] 503 | [:!Q8 :!C8 :ghostty] 504 | [:!Q9 :!C9 :ghostty] 505 | ; kitty 506 | [:left_option :left_option :kitty {:alone [:!Ta :z]}] 507 | [:right_option :right_option [:kitty :!tmux_sync_panes] {:alone [:!Ta :!Ssemicolon [:type_cr "setw synchronize-panes on"] ["tmux_sync_panes" 1]]}] 508 | [:right_option :right_option [:kitty :tmux_sync_panes] {:alone [:!Ta :!Ssemicolon [:type_cr "setw synchronize-panes off"] ["tmux_sync_panes" 0]]}] 509 | [:right_command :right_command [:kitty ["tmux_prefix" 0]] {:alone :!Ta}] 510 | [:right_command :right_command [:kitty ["tmux_prefix" 1]] {:alone :!Tb}] 511 | ; rotate between ctrl+a & ctrl+b as a tmux prefix 512 | [:!Qspacebar ["tmux_prefix" 1] [:kitty ["tmux_prefix" 0]]] 513 | [:!Qspacebar ["tmux_prefix" 0] [:kitty ["tmux_prefix" 1]]] 514 | [:!Cf [:!Ta :c] :kitty] ; Cmd+T on Colemak 515 | [:!Cw [:!Ta :k] :kitty] 516 | [:!C0 [:!Ta :0] :kitty] 517 | [:!C1 [:!Ta :1] :kitty] 518 | [:!C2 [:!Ta :2] :kitty] 519 | [:!C3 [:!Ta :3] :kitty] 520 | [:!C4 [:!Ta :4] :kitty] 521 | [:!C5 [:!Ta :5] :kitty] 522 | [:!C6 [:!Ta :6] :kitty] 523 | [:!C7 [:!Ta :7] :kitty] 524 | [:!C8 [:!Ta :8] :kitty] 525 | [:!C9 [:!Ta :9] :kitty] 526 | [:!CSf :vk_none :kitty] 527 | [:!Qf :!QSt :kitty] 528 | [:!Q0 :!C0 :kitty] 529 | [:!Q1 :!C1 :kitty] 530 | [:!Q2 :!C2 :kitty] 531 | [:!Q3 :!C3 :kitty] 532 | [:!Q4 :!C4 :kitty] 533 | [:!Q5 :!C5 :kitty] 534 | [:!Q6 :!C6 :kitty] 535 | [:!Q7 :!C7 :kitty] 536 | [:!Q8 :!C8 :kitty] 537 | [:!Q9 :!C9 :kitty] 538 | ; mailmate 539 | [:right_command :right_command :mailmate {:alone :!COTd}] 540 | [:right_option :right_option :mailmate {:alone :!COu}] 541 | ; min browser 542 | [:right_command :right_command :min {:alone :!CSr}] 543 | [:right_option :right_option :min {:alone :!CSe}] 544 | ; obsidian 545 | [:right_command :right_command :obsidian {:alone :!Ct}] 546 | ; opera 547 | [:!Qspacebar :!COi :opera] 548 | ; safari 549 | [:!CSf :vk_none :safari] 550 | [:!Qf :!QSt :safari] 551 | [:!Qleft_command [:!Cl :!Cv :return_or_enter] :safari] 552 | [:!Cright_command [:button2 :c :return_or_enter] :safari] 553 | [:left_control :left_control :safari {:alone :!CSbackslash}] 554 | [:left_option :left_option :safari {:alone :!COk}] ; toggle dark mode 555 | [:right_command :right_command :safari {:alone :!CT1}] 556 | [:right_option :left_option :safari {:alone :!CSr}] 557 | [:!Sright_command :safari-toggle_reader :safari] 558 | [:!Qspacebar :!COi :safari] 559 | ; slack 560 | [:right_command :right_command :slack {:alone :!CSd}] 561 | ; teams 562 | [:left_option :left_option :teams {:alone :!CSm}] ; toggle microphone 563 | ; vivaldi 564 | [:!CSf :vk_none :vivaldi] 565 | [:!Qf :!QSt :vivaldi] 566 | [:right_command :right_command :vivaldi {:alone :!COb}] 567 | [:right_option :right_option :vivaldi {:alone :!COTn}] 568 | ;; [:right_option :left_option :vivaldi {:alone :!CSr}] 569 | [:!Qspacebar :!COi :vivaldi] 570 | ; vlc 571 | [:right_command :right_command :vlc {:alone :!COp}] 572 | [:right_option :right_option :vlc {:alone :!C3}] 573 | ; vscode 574 | ; rotate between showing/hiding terminal, switching between them visible and maximized terminal 575 | [:!Qspacebar ["vscode_terminal" 1] [:vscode ["vscode_terminal" 0]]] 576 | [:!Qspacebar ["vscode_terminal" 2] [:vscode ["vscode_terminal" 1]]] 577 | [:!Qspacebar ["vscode_terminal" 0] [:vscode ["vscode_terminal" 2]]] 578 | ; based on the variable above, work with terminal based on preference 579 | [:right_command :right_command [:vscode ["vscode_terminal" 0]] {:alone :toggle_terminal_or_editor}] 580 | [:right_command :right_command [:vscode ["vscode_terminal" 1]] {:alone :toggle_terminal}] 581 | [:right_command :right_command [:vscode ["vscode_terminal" 2]] {:alone [:!COm :toggle_terminal]}] 582 | [:!Creturn_or_enter :!TOn :vscode] ; run code 583 | [:right_option :right_option :vscode {:alone :!Cb}] ; toggle side bar 584 | [:left_option :left_option :vscode {:alone :!Tw}] ; switch to window 585 | ; workflowy 586 | [:right_command :right_command :workflowy {:alone :!Cup_arrow}] 587 | [:!Sright_command :!Sright_command :workflowy {:alone :!Cdown_arrow}] 588 | [:right_option :right_option :workflowy {:alone :!Cslash}] 589 | ; zoom 590 | [:right_option :right_option :zoom {:alone :!Oy}] ; toggle raised hand 591 | [:right_command :right_command :zoom {:alone [:!Cu :!CSh]}] ; toggle participant list & chat 592 | [:left_option :left_option :zoom {:alone :!CSa}] ; toggle microphone 593 | [:!Cleft_option :!CSv :zoom] ; toggle video 594 | [:!Qleft_option :!CSv :zoom] ; toggle video 595 | [:!Qleft_command :!CSs :zoom] ; toggle sharing 596 | ] 597 | } 598 | { 599 | :des "Extended Layer - Spacebar" 600 | :rules [ 601 | [:##spacebar [["extend" 1][:is_in_gdoc]] :!blocked {:afterup [["extend" 0]["in-gdoc" 0]] :alone :spacebar}] 602 | :extend 603 | ;~ system wide shortcuts for top utilities 604 | [:escape nil nil {:alone :escape :held :system-force_quit_apps}] 605 | [:non_us_backslash nil nil {:alone :!Fh :held :activate_hazeover}] 606 | [:tab :vk_none] 607 | [:return_or_enter :!Fspacebar] 608 | ;~ placing this up here to precede the general declaration of number -> functions 609 | [:##2 :!Cs :drafts] 610 | ;~ power apps & window positioning - 1 hand switching 611 | [:!Rq :!!1] 612 | [:!Rw :!!2] 613 | [:!Re :!!3] 614 | [:!Rr :!!4] 615 | [:!Rt :!!5] 616 | [:!Ry :!!6] 617 | [:q ["fn_base" 1] nil {:afterup ["fn_base" 0] :alone :!!1}] 618 | [:w ["fn_ctrl" 1] nil {:afterup ["fn_ctrl" 0]}] 619 | [:e ["fn_desk" 1] nil {:afterup ["fn_desk" 0]}] 620 | [:r ["fn_tmux" 1] nil {:afterup ["fn_tmux" 0]}] 621 | [:t ["fn_nvim" 1] nil {:afterup ["fn_nvim" 0]}] 622 | [:y ["fn_nvim" 1] nil {:afterup ["fn_nvim" 0] :alone :!!6}] 623 | ;~ switch from one stack to the other 624 | [:left_shift :left_shift nil {:alone :!Fj}] 625 | [:right_shift :right_shift nil {:alone :!Fl}] 626 | ;~* function keys & social apps 627 | [:##1 nil nil {:alone :f1 :held [:open "Transmission"]}] 628 | [:##2 nil nil {:alone :f2 :held [:open "Google Chrome"]}] 629 | [:##3 nil nil {:alone :f3 :held [:open "Messages"]}] 630 | [:##4 nil nil {:alone :f4 :held :!CS4}] 631 | [:##5 nil nil {:alone :f5 :held :!CS5}] 632 | [:##6 nil nil {:alone :f6 :held [:open_social "Discord"]}] 633 | [:##7 nil nil {:alone :f7 :held [:open_social "Telegram"]}] 634 | [:##8 nil nil {:alone :f8 :held [:open_social "WhatsApp"]}] 635 | [:##9 nil nil {:alone :f9 :held [:open_social "Slack"]}] 636 | [:##0 nil nil {:alone :f10 :held [:open_social "Messages"]}] 637 | [:##hyphen nil nil {:alone :f11 :held [:open_social "Skype"]}] 638 | [:##equal_sign nil nil {:alone :f12 :held [:open_social "zoom.us"]}] 639 | ; per-app key definitions 640 | ; arc 641 | [:u :!Cleft_arrow :arc] 642 | [:o :!Cright_arrow :arc] 643 | [:comma :!CSopen_bracket :arc] 644 | [:period :!CSclose_bracket :arc] 645 | [:!Tcomma :!Oup_arrow :arc] 646 | [:!Tperiod :!Odown_arrow :arc] 647 | ; chrome 648 | [:u :!Cleft_arrow :chrome] 649 | [:o :!Cright_arrow :chrome] 650 | [:comma :safari-prev_tab :chrome] 651 | [:period :safari-next_tab :chrome] 652 | ; evernote 653 | [:u :evernote-beginning_of_line :evernote] 654 | [:o :evernote-end_of_line :evernote] 655 | ; drafts 656 | [:u :drafts-beginning_of_line :drafts] 657 | [:o :drafts-end_of_line :drafts] 658 | [:comma :!TSdown_arrow :drafts] 659 | [:period :!TSup_arrow :drafts] 660 | ; emacs 661 | [:u :!Cleft_arrow :emacs] 662 | [:o :!Cright_arrow :emacs] 663 | ; ghostty 664 | [:u [:!Ta :a] :ghostty] 665 | [:o :!Te :ghostty] 666 | [:!Cj [:!Ta :left_arrow] :ghostty] 667 | [:!Ck [:!Ta :down_arrow] :ghostty] 668 | [:!Ci [:!Ta :up_arrow] :ghostty] 669 | [:!Cl [:!Ta :right_arrow] :ghostty] 670 | [:!Oj :!Ob :ghostty] 671 | [:!Ol :!Of :ghostty] 672 | [:!Tj [:escape :!Tw :left_arrow] :ghostty] 673 | [:!Tk [:escape :!Tw :down_arrow] :ghostty] 674 | [:!Ti [:escape :!Tw :up_arrow] :ghostty] 675 | [:!Tl [:escape :!Tw :right_arrow] :ghostty] 676 | [:comma [:!Ta :p] :ghostty] 677 | [:period [:!Ta :n] :ghostty] 678 | ; goodnotes 679 | [:g :e :goodnotes] 680 | [:v :p :goodnotes] 681 | [:d :l :goodnotes] 682 | [:h :h :goodnotes] 683 | [:caps_lock :s :goodnotes] 684 | [:a :!Chyphen :goodnotes] 685 | [:s :!Cequal_sign :goodnotes] 686 | [:f {:pkey :button1} :goodnotes] 687 | ; firefox 688 | [:comma :!TStab :firefox] 689 | [:period :!Ttab :firefox] 690 | [:right_command :!Tperiod :firefox] 691 | ; kitty 692 | [:!Tcomma :kitty-prev_tab :kitty] 693 | [:!Tperiod :kitty-next_tab :kitty] 694 | [:u [:!Ta :a] :kitty] 695 | [:o :!Te :kitty] 696 | [:!Cj [:!Ta :left_arrow] :kitty] 697 | [:!Ck [:!Ta :down_arrow] :kitty] 698 | [:!Ci [:!Ta :up_arrow] :kitty] 699 | [:!Cl [:!Ta :right_arrow] :kitty] 700 | [:!Oj :!Ob :kitty] 701 | [:!Ol :!Of :kitty] 702 | [:!Tj [:escape :!Tw :left_arrow] :kitty] 703 | [:!Tk [:escape :!Tw :down_arrow] :kitty] 704 | [:!Ti [:escape :!Tw :up_arrow] :kitty] 705 | [:!Tl [:escape :!Tw :right_arrow] :kitty] 706 | [:comma [:!Ta :p] :kitty] 707 | [:period [:!Ta :n] :kitty] 708 | ; mailmate 709 | [:u :!Cleft_arrow :mailmate] 710 | [:o :!Cright_arrow :mailmate] 711 | ; messages 712 | [:!Ti :!TStab :messages] 713 | [:!Tk :!Ttab :messages] 714 | [:comma :!TStab :messages] 715 | [:period :!Ttab :messages] 716 | ; min browser 717 | [:comma :!TStab :min] 718 | [:period :!Ttab :min] 719 | ; opera 720 | [:comma :opera-prev_tab :opera] 721 | [:period :opera-next_tab :opera] 722 | ; safari 723 | [:u :!Cleft_arrow :safari] 724 | [:o :!Cright_arrow :safari] 725 | [:right_command :!COk :safari] 726 | [:comma :safari-prev_tab :safari] 727 | [:period :safari-next_tab :safari] 728 | [:!Tcomma :!Oup_arrow [:safari ["in-gdoc" 1]]] 729 | [:!Tperiod :!Odown_arrow [:safari ["in-gdoc" 1]]] 730 | ; stickies 731 | [:u :!Cleft_arrow :stickies] 732 | [:o :!Cright_arrow :stickies] 733 | [:!Oi [:!Cleft_arrow :!CSright_arrow :!Cx :delete_forward :up_arrow :!Cleft_arrow :!COSv :return_or_enter :up_arrow] :stickies] 734 | [:!Ok [:!Cleft_arrow :!CSright_arrow :!Cx :delete_forward :down_arrow :!Cleft_arrow :!COSv :return_or_enter :up_arrow] :stickies] 735 | ; telegram 736 | [:comma :!COup_arrow :telegram] 737 | [:period :!COdown_arrow :telegram] 738 | ; vivaldi 739 | [:u :!Cleft_arrow :vivaldi] 740 | [:o :!Cright_arrow :vivaldi] 741 | [:comma :!CSopen_bracket :vivaldi] 742 | [:period :!CSclose_bracket :vivaldi] 743 | [:!Tcomma :!Oup_arrow :vivaldi] 744 | [:!Tperiod :!Odown_arrow :vivaldi] 745 | ; vscode 746 | [:comma :focus_editor_left :vscode] 747 | [:period :focus_editor_right :vscode] 748 | [:##right_command :!COm :vscode] ; maximize panel 749 | [:!Tcomma :!COTleft_arrow :vscode] 750 | [:!Tperiod :!COTright_arrow :vscode] 751 | ; workflowy 752 | [:!Ok :!CSdown_arrow :workflowy] 753 | [:!Oi :!CSup_arrow :workflowy] 754 | [:comma :!Ccomma :workflowy] 755 | [:period :!Cperiod :workflowy] 756 | [:!Ti :!CS9 :workflowy] 757 | [:!Tk :!CS0 :workflowy] 758 | [:return_or_enter :!Creturn_or_enter :workflowy] 759 | ; zoom 760 | [:comma :!Tp :zoom] 761 | [:period :!Tn :zoom] 762 | ; global settings 763 | [:!Tj :home] 764 | [:!Tl :end] 765 | [:!TSj :!Shome] 766 | [:!TSl :!Send] 767 | [:!Ti :page_up] 768 | [:!Tk :page_down] 769 | [:!TSi :!Spage_up] 770 | [:!TSk :!Spage_down] 771 | ; reposition some keys closer 772 | [:##f :return_or_enter] 773 | [:##g :delete_or_backspace] 774 | ; modifiers 775 | [:##caps_lock :left_control nil {:alone :escape}] 776 | [:##a :left_shift] 777 | [:##s :left_option] 778 | [:##d :vk_none] 779 | ; arrows 780 | [:##j :left_arrow] 781 | [:##k :down_arrow] 782 | [:##i :up_arrow] 783 | [:##l :right_arrow] 784 | ; shortcuts 785 | [:!!u :page_up] 786 | [:!!o :page_down] 787 | [:##u :home] 788 | [:##o :end] 789 | ; edit/organize text properly 790 | [:##quote :insert] 791 | [:##h :delete_or_backspace] 792 | [:##semicolon :delete_forward] 793 | ; spaces navigation 794 | ; [:n :!!left_arrow] 795 | [:m :!!left_arrow] 796 | [:slash :!!right_arrow] 797 | ; undo, cut, copy, paste on colemak 798 | [:##z :!Cz][:##x :!Cx][:##c :!Cc][:##v :!Cv] 799 | ] 800 | } 801 | { 802 | :des "Colemak Layout" 803 | :rules [ 804 | ; colemak 805 | [:condi :!blocked] 806 | ; mod-wide colemak on the apple keyboard (full layout below; some keys are the same as QWERTY) 807 | ; [:##non_us_backslash :grave_accent_and_tilde] 808 | ; [:##grave_accent_and_tilde :non_us_backslash] 809 | [:##q :q][:##w :w][:##e :f][:##r :p][:##t :g][:##y :j][:##u :l][:##i :u][:##o :y][:##p :semicolon] 810 | [:##a :a][:##s :r][:##d :s][:##f :t][:##g :d][:##h :h][:##j :n][:##k :e][:##l :i][:##semicolon :o] 811 | [:##z :z][:##x :x][:##c :c][:##v :v][:##b :b][:##n :k][:##m :m] 812 | ] 813 | } 814 | ] 815 | } 816 | 817 | ;; rule [:period ["media-mode" 1] nil {:afterup ["media-mode" 0] :alone :period}] 818 | ;; |_____| |_______________| |_| |_________________________________________| 819 | ;; 820 | ;; 821 | ;; ! | means mandatory - modifier(s) alone when pressend change behavior 822 | ;; # | means optional - modifiers are optional (but atleast one necessary) 823 | ;; 824 | ;; :!Ca is keycode :a and prefix a with !C 825 | ;; 826 | ;; C | left_command 827 | ;; T | left_control 828 | ;; O | left_option 829 | ;; S | left_shift 830 | ;; F | fn 831 | ;; Q | right_command 832 | ;; W | right_control 833 | ;; E | right_option 834 | ;; R | right_shift 835 | ;; P | caps_lock 836 | ;; 837 | ;; ## | optional any (this has no effect when used on the RHS; only LHS) 838 | ;; !! | command + control + option + shift (hyper) 839 | ;; 840 | ;; to understand better how modifiers work in karabiner 841 | ;; karabiner definition of mandatory and optional 842 | ;; https://karabiner-elements.pqrs.org/docs/json/complex-modifications-manipulator-definition/from/modifiers/ 843 | ;; 844 | ;; need to prefix C T O S F P with ! or # 845 | ;; 846 | ;; code for all this: 847 | ;; https://github.com/yqrashawn/GokuRakuJoudo/blob/b9b334a187379f9bc8182ad59e2cca2a1789e9c0/src/karabiner_configurator/keys.clj#L68 848 | ;; 849 | ;; 850 | ;; list of keys usable in Karabiner 851 | ;; https://github.com/pqrs-org/Karabiner-Elements/issues/925#issuecomment-323984568 852 | ;; 853 | ;; Sample mouse event remapping 854 | ;; Could be used in a layer. Intercepting events from mice interferes with the scrollwheel. 855 | ;; [{:pkey :button2} :delete_forward] 856 | ;; 857 | ;; 858 | ;; URL of extend layer - https://forum.colemak.com/topic/2014-extend-extra-extreme/ 859 | --------------------------------------------------------------------------------