Skip to content

Instantly share code, notes, and snippets.

@narze
Last active March 29, 2022 21:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save narze/1eb7d0f14b6177ea0360f5dc214867b0 to your computer and use it in GitHub Desktop.
Save narze/1eb7d0f14b6177ea0360f5dc214867b0 to your computer and use it in GitHub Desktop.
Goku config with SuperDuper mode (S+D)
{:templates {:alfred "osascript -e 'tell application \"Alfred 3\" to run trigger \"%s\" in workflow \"%s\" with argument \"\"'"
:km "osascript -e 'tell application \"Keyboard Maestro Engine\" to do script \"%s\"'"}
:simlayers {
:f-mode {:key :f}
:o-mode {:key :o}
:h-mode {:key :h}
:superduper-mode {:key :f20} ; Bind an unused key
}
:devices {:filco-bt [{:vendor_id 2652 :product_id 34050}]
:planck [{:vendor_id 65261 :product_id 24672}]
:planck-light [{:vendor_id 65261 :product_id 24677}]
:ergodox-infinity [{:vendor_id 65261 :product_id 25700}]}
:main [{:des "Swap Option / Command on certain devices" :rules [
[:##left_command :left_option [:filco-bt]]
[:##left_option :left_command [:filco-bt] {:alone :!Shyphen}]]}
{:des "Caps -> Hyper / Esc" :rules [[:##caps_lock :!CTOleft_shift nil {:alone :escape}]]}
{:des "Cmd -> Cmd / Underscore" :rules [[:##left_command :left_command nil {:alone :!Shyphen}]]}
{:des "LShift -> Shift / (" :rules [[:##left_shift :right_shift nil {:held :left_shift :alone :!S9}]]}
{:des "RShift -> Shift / )" :rules [[:##right_shift :left_shift nil {:held :right_shift :alone :!S0}]]}
{:des "F+J -> Delete" :rules [[[:f :j] :delete_or_backspace]]}
{:des "F-J/K -> Delete" :rules [:f-mode [:j :delete_or_backspace] [:k :delete_or_backspace]]}
{:des "F-L -> Delete Word" :rules [:f-mode [:l :!Odelete_or_backspace]]}
{:des "F-; -> Delete Line" :rules [:f-mode [:semicolon :!Cdelete_or_backspace]]}
;; {:des "Disable backspace" :rules [[:delete_or_backspace "osascript -e beep" [:!ergodox-infinity]]]}
; SuperDuper Mode with S+D
{:des "SuperDuper <- S+D" :rules [[{:sim [:s :d]
:simo {:interrupt true
:dorder :insensitive
:uorder :insensitive
:afterup {:set ["superduper-mode" 0]}}} {:set ["superduper-mode" 1]}]]}
{:des "SuperDuper H -> Left" :rules [:superduper-mode [:##h :left_arrow]]}
{:des "SuperDuper J -> Down" :rules [:superduper-mode [:##j :down_arrow]]}
{:des "SuperDuper K -> Up" :rules [:superduper-mode [:##k :up_arrow]]}
{:des "SuperDuper L -> Right" :rules [:superduper-mode [:##l :right_arrow]]}
{:des "SuperDuper F -> Delete" :rules [:superduper-mode [:##f :delete_or_backspace]]}
{:des "SuperDuper ; -> Forward Delete" :rules [:superduper-mode [:##semicolon :delete_forward]]}
{:des "SuperDuper I -> Prev Tab" :rules [:superduper-mode [:##i :!CSopen_bracket]]}
{:des "SuperDuper O -> Next Tab" :rules [:superduper-mode [:##o :!CSclose_bracket]]}
{:des "SuperDuper A -> Option" :rules [:superduper-mode [:##a :left_option]]}
{:des "SuperDuper V -> Shift" :rules [:superduper-mode [:##v :left_shift]]}
; H for Hyper
{:des "H for Hyper" :rules [:h-mode
[:a :!!a]
[:b :!!b]
[:c :!!c]
[:d :!!d]
[:e :!!e]
[:f :!!f]
[:g :!!g]
[:i :!!i]
[:j :!!j]
[:k :!!k]
[:l :!!l]
[:m :!!m]
[:n :!!n]
[:o :!!o]
[:p :!!p]
[:q :!!q]
[:r :!!r]
[:s :!!s]
[:t :!!t]
[:u :!!u]
[:v :!!v]
[:w :!!w]
[:x :!!x]
[:y :!!y]
[:z :!!z]
]}
]
;; code won't read cheatsheet section
;; ! stand for mandatory
;; # stand for optional
;; C T O S for left command control optional shift
;; F for fn
;; need to prefix C T O S F with ! or #
:cheatsheet {:!Ca "command a" ;; mandatory left_command
:!Ta "control a" ;; mandatory left_control
:!Oa "option a"
:!Sa "shift a"
:#Sa "shift a" ;; keycode a, optional left_shift
:!CTOa "command control option a"
:!Cspacebar "command space"
:!Fa "fn a"
:##a "keycode a optional any"
:!!a "mandatory hyper(control command option shift) a "}}
@narze
Copy link
Author

narze commented May 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment