Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
356 lines (355 sloc) 19 KB
{:templates {:launch "osascript -e 'tell application \"Alfred 3\" to run trigger \"launch%s\" in workflow \"yqrashawn.workflow.launcher\" with argument \"\"'"
:alf "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\"'"
:2do "open 'twodo://x-callback-url/%s'"
:kb-maestro "osascript -e 'tell application \"Keyboard Maestro Engine\" to do script \"%s\"'"}
:layers {:tab-mode {:key :tab :afterup [{:set ["chunkwm-move-mode" 0]}
{:set ["chunkwm-scale-mode" 0]}]}
:chunkwm-move-mode {:key :f :condi :tab-mode}
:chunkwm-scale-mode {:key :c :condi :tab-mode}}
:simlayers {:contexts-f-mode {:key :f}
:2do-mode {:key :t}
:2do-s-mode {:key :s :condi :2do}
:emacs-s-mode {:key :s :condi :Emacs}
:vi-mode {:key :d}
:vi-visual-mode {:key :v :condi :!vim-mode-disabled-application}
:launch-mode {:key :w}
:emacs-winmove-mode {:key :q :condi :Emacs}
:tmux-winmove-mode {:key :q :condi :Terminals}
:q-mode {:key :q}
:period-mode {:key :period :afterup {:set ["period-comma-mode" 0]}}
:comma-mode {:key :comma}
:alfred-mode {:key :z}
:finder-alfred-mode {:key :z :condi :Finder}
:browsers-alfred-mode {:key :z :condi :Browsers}
:e-mode {:key :e}}
:main [{:des "disable command-tab"
:rules [[:!Ctab :vk_none]]}
{:des "contexts"
:rules [[:escape [:escape ["in-contexts" 0]] ["in-contexts" 1]]
[{:pkey :button1} [{:pkey :button1} ["in-contexts" 0]] ["in-contexts" 1]]
[:left_control [:left_control] ["in-contexts" 1] {:alone [:escape ["in-contexts" 0]]}]
[:##caps_lock [:left_control] ["in-contexts" 1] {:alone [:escape ["in-contexts" 0]]}]
[:return_or_enter [:return_or_enter ["in-contexts" 0]] ["in-contexts" 1]]
[:!Tm [:return_or_enter ["in-contexts" 0]] ["in-contexts" 1]]
:contexts-f-mode
[:j [["in-contexts" 1] :f16] ["in-contexts" 0]]
[:k [["in-contexts" 1] :f16] ["in-contexts" 0]]
[:j :down_arrow ["in-contexts" 1]]
[:k :up_arrow ["in-contexts" 1]]
[:l [:return_or_enter ["in-contexts" 0]] ["in-contexts" 1]]]}
#_{:des "in-alfred"
:rules [[:!Tw :!Odelete_or_backspace ["in-alfred" 1]]
[:escape [:escape ["in-alfred" 0]] ["in-alfred" 1]]
[:left_control :left_control ["in-alfred" 1] {:alone [:escape ["in-alfred" 0]]}]
[:!Ctab [:!Ctab ["in-alfred" 0]] ["in-alfred" 1]]
[:!Cright_command [:!Ctab ["in-alfred" 0]] ["in-alfred" 1]]
[:!Tsemicolon [:!Treturn_or_enter ["in-alfred" 0]] ["in-alfred" 1]]
[:!Tl [:return_or_enter ["in-alfred" 0]] ["in-alfred" 1]]
[:!Tj :down_arrow ["in-alfred" 1]]
[:!Tk :up_arrow ["in-alfred" 1]]
[:!Oh :left_arrow ["in-alfred" 1]]
[:!Oj :down_arrow ["in-alfred" 1]]
[:!Ok :up_arrow ["in-alfred" 1]]
[:!Ol :right_arrow ["in-alfred" 1]]
[:!OSh :!OSleft_arrow ["in-alfred" 1]]
[:!OSj :!OSdown_arrow ["in-alfred" 1]]
[:!OSk :!OSup_arrow ["in-alfred" 1]]
[:!OSl :!OSright_arrow ["in-alfred" 1]]]}
{:des "2do"
:rules [:2do-mode
[:l [:km "2Do: Capture URL to Read"] :Browsers]
[:spacebar [:2do "showToday"]]
:2do-s-mode
[:j [:!Cdown_arrow]]
[:k [:!Cup_arrow]]
[:l [:j]]
[:f [:!Cf]]
[:d [:!C5]]
[:i [:!C0]]
[:t [:!C2]]
[:a [:!C1]]
[:v [:!C4]]]}
{:des "s-mode in emacs, awesome-tab"
:rules [:emacs-s-mode
;; [:h [:!Tx :!T9 {:key :h :repeat false}]]
;; [:j [:!Tx :!T9 {:key :j :repeat false}]]
;; [:k [:!Tx :!T9 {:key :k :repeat false}]]
;; [:l [:!Tx :!T9 {:key :l :repeat false}]]
;; [:n [:!Tx :!T9 {:key :n :repeat false}]]
;; [:p [:!Tx :!T9 {:key :p :repeat false}]]
[:h :!!h]
[:j :!!j]
[:k :!!k]
[:l :!!l]
[:n :!!n]
[:p :!!p]
[:delete_or_backspace [:!Tx :!T9 :!Sk]]
[:open_bracket [:!Tx :!T9 :open_bracket]]
[:close_bracket [:!Tx :!T9 :close_bracket]]]}
{:des "Vi Mode [D as Trigger Key]"
:rules [:vi-mode
[:##j :down_arrow]
[:##k :up_arrow]
[:##h :left_arrow]
[:##l :right_arrow]
[:##b :!Oleft_arrow]
[:##w :!Oright_arrow]
[:##0 :!Ta]
[:##4 :!Te]]}
{:des "Vi Visual Mode"
:rules [:vi-visual-mode
[:##j :!Sdown_arrow]
[:##k :!Sup_arrow]
[:##h :!Sleft_arrow]
[:##l :!Sright_arrow]
[:##b :!SOleft_arrow]
[:##w :!SOright_arrow]
[:##0 :!SCleft_arrow]
[:##4 :!SCright_arrow]
[:##open_bracket :!SOup_arrow]
[:##close_bracket :!SOdown_arrow]]}
{:des "Emacs switch buffer"
:rules [:Emacs
[:tab :!Ttab :period-mode]
[:tab :!TStab :comma-mode]]}
{:des "launcher mode"
:rules [:launch-mode
[:j [:launch "Alacritty"]]
[:k [:launch "Emacs"]]
[:l [:launch "Safari"]]
[:m [:launch "Mail"]]
[:v [:launch "WeChat"]]
[:q [:launch "KE"]]
[:f [:launch "Finder"]]
[:9 [:launch "PDFExpert"]]
[:comma [:launch "Safari"]]
[:h [:launch "Chrome"]]
[:period [:launch "Paw"]]
[:equal_sign [:launch "Textual"]]
[:8 [:launch "KEEvents"]]
[:b [:launch "BearyChat"]]
[:c [:launch "VSCode"]]
[:t [:launch "2do"]]
[:r [:launch "Timing"]]]}
{:des "caps_lock"
:rules [[:##caps_lock :left_control nil {:alone :escape}]]}
{:des "HHKB, FILCO MINILA Change left control to esc if alone"
:rules [[:##left_control :left_control [:hhkb-bt :hhkb :hhkb-tmk :filco-minila] {:alone :escape}]]}
{:des "Left Right Shift Press Alone"
:rules [[:right_shift :right_shift nil {:alone :!TSz}]]}
{:des "Change right_command to command-tab when used alone"
:rules [[:right_command :right_command nil {:alone [:!Ctab]}]]}
{:des "Change left_option to f18 when used alone"
:rules [[:left_option :left_option nil {:alone [:f18]}]]}
{:des "Quit application by pressing command-q twice" :rules [[:!C#Pq [:!Cq ["command-q" 0]] ["command-q" 1]]
[:!C#Pq ["command-q" 1] nil {:delayed {:invoked ["command-q" 0] :canceled ["commandq" 0]}}]]}
{:des "Change right_option to switch to second recent application when used alone"
:rules [[:right_option :right_option nil {:alone ["osascript ~/Dropbox/sync/Automator/switch-to-second-previous-app.scpt"]}]]}
{:des "some simultaneous keys"
:rules [[[:h :l] [:alf "helpSearch" "com.tedwise.menubarsearch"]]
[[:j :l] [:f19 ["in-alfred" 1]]]]}
{:des "alfred mode"
:rules [[:l :!COi :browsers-alfred-mode]
[:l :!CTslash [:finder-alfred-mode ["in-alfred" 1]]]
:alfred-mode
[:h [[:alf "search repos" "me.lachlan.githubjump"] ["in-alfred" 1]]]
[:j [:alf "searchGithub" "nikivi.search-the-web"]]
[:return_or_enter [:alf "web searches" "nikivi.web.searches"]]
[:x [:alf "killProcess" "com.ngreenstein.alfred-process-killer"]]
[:t [:alf "repos" "net.deanishe.alfred-git-repos"]]
[:k [[:alf "history" "net.deanishe.alfred.safari"] ["in-alfred" 1]]]
[:m [:alf "tab" "net.deanishe.alfred.safari"]]
[:y [:!!grave_accent_and_tilde ["in-alfred" 1]]]
[:o :!CTOS0]
[:0 [:alf "pasteBack" "yqrashawn.com.ewe"]]
[:semicolon [:alf "localport" "in.fech.localport"]]
[:q "osascript -e 'tell application \"Keyboard Maestro Engine\" to do script \"Quick Macro 1\"'"]
[:close_bracket :!CTOSclose_bracket]
[:hyphen :!!hyphen]
[:right_command :!!3]]}
{:des "q"
:rules [:emacs-winmove-mode
[:h [:!Tx :7 :w :h]]
[:j [:!Tx :7 :w :j]]
[:k [:!Tx :7 :w :k]]
[:l [:!Tx :7 :w :l]]
[:v [:!Tx :3]]
[:s [:!Tx :2]]
[:m [:!Tx :1]]
[:b [:!Tx :0]]
:tmux-winmove-mode
[:comma [:!Tq :comma]]
[:open_bracket [:!Tq :open_bracket]]
[:y [:!Tq :y]]
[:f [:!Tq :f]]
[:e [:!Tq :e]]
[:w [:!Tq :w]]
[:h [:!Tq :h]]
[:j [:!Tq :j]]
[:k [:!Tq :k]]
[:l [:!Tq :l]]
[:v [:!Tq :v]]
[:s [:!Tq :s]]
[:m [:!Tq :z]]
[:b [:!Tq :x]]
[:c [:!Tq :c]]
[:1 [:!Tq :1]]
[:2 [:!Tq :2]]
[:3 [:!Tq :3]]
[:4 [:!Tq :4]]
[:5 [:!Tq :5]]]}
{:des "chunkwm mode"
:rules [:chunkwm-move-mode
[:h "/usr/local/bin/chunkc tiling::window --warp west"]
[:j "/usr/local/bin/chunkc tiling::window --warp south"]
[:k "/usr/local/bin/chunkc tiling::window --warp north"]
[:l "/usr/local/bin/chunkc tiling::window --warp east"]
:chunkwm-scale-mode
[:h "/usr/local/bin/chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge west"]
[:j "/usr/local/bin/chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge south"]
[:k "/usr/local/bin/chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge north"]
[:l "/usr/local/bin/chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge east"]
:tab-mode
[:h "/usr/local/bin/chunkc tiling::window --focus west"]
[:j "/usr/local/bin/chunkc tiling::window --focus south"]
[:k "/usr/local/bin/chunkc tiling::window --focus north"]
[:l "/usr/local/bin/chunkc tiling::window --focus east"]
[:n "/usr/local/bin/chunkc tiling::window --focus next"]
[:p "/usr/local/bin/chunkc tiling::window --focus prev"]
[:r "/usr/local/bin/chunkc tiling::desktop --rotate 90"]
[:spacebar "/usr/local/bin/chunkc tiling::window --toggle fullscreen"]
[:a "/usr/local/bin/chunkc tiling::window --toggle float"]
[:b "/usr/local/bin/chunkc tiling::desktop --layout bsp"]
[:m "/usr/local/bin/chunkc tiling::desktop --layout monocle"]
[:x "/usr/local/bin/chunkc tiling::window --close"]
[:open_bracket "/usr/local/bin/chunkc tiling::window --send-to-monitor prev"]
[:close_bracket "/usr/local/bin/chunkc tiling::window --send-to-monitor next"]]}
{:des "comma mode"
:rules [:comma-mode
[:a :open_bracket]
[:s :close_bracket]
[:d :!S7]
[:f :!S8]
[:q :!Shyphen]
[:w :!Sequal_sign]
[:e :!S5]
[:r :!S6]]}
{:des "period mode"
:rules [:period-mode
[:comma ["period-comma-mode" 1] nil {:alone :comma :afterup ["period-comma-mode" 0]}]
[:a [:!Sgrave_accent_and_tilde :slash]]
[:s [:period :!S8]]
[:d :!S9]
[:f :!S0]
[:q :hyphen]
[:w :equal_sign]
[:e :!Sopen_bracket]
[:r :!Sclose_bracket]]}
{:des "chrome debug mode"
:rules [[:condi :Chromes :tab-mode]
[:q :!Csemicolon]
[:w :!CSsemicolon]
[:e :!Cquote]
[:r :!Cf8]
[:1 :!Cbackslash]
[:2 "~/local/bin/cliclick kd:ctrl c:+0,+0 ku:ctrl t:continue kp:return"]
[:3 :f9]]}
{:des "Mouse button"
:rules [[{:pkey :button5} :mission_control]
[{:pkey :button4} [{:pkey :button1} {:pkey :button1} :!!grave_accent_and_tilde]]]}
{:des "Emacs key bindings [control+keys] (rev 10)"
:rules [[:!T#Sy :!Cv :!Emacs]
:!emacs-mode-disable-app
[:!T#Od :delete_forward]
[:!T#Oh :delete_or_backspace]
[:!T#SOw :!Odelete_or_backspace]
[:!T#Oi :tab]
[:!T#Oopen_bracket :escape]
[:!T#OSm :return_or_enter]
[:!T#OSb :left_arrow]
[:!T#OSf :right_arrow]
[:!T#OSb :left_arrow]
[:!T#OSn :down_arrow]
[:!T#OSp :up_arrow]
[:!T#Sv :page_down]
[:!T#Sa :!Cleft_arrow]
[:!T#Se :!Cright_arrow]]}
#_{:des "Anti-RSI App Switch (LCMD+Space to LCMD+Tab and reverse +LControl)."
:rules [[:!Cspacebar :!Ctab]
[:!CTspacebar :!CStab]]}]
:devices {:macbook-internal [{:product_id 631 :vendor_id 1452}]
:filco-minila [{:product_id 34050 :vendor_id 2652}]
:hhkb-tmk [{:vendor_id 65261 :product_id 51966}]
:hhkb-bt [{:vendor_id 1278 :product_id 514}]
:hhkb [{:vendor_id 2131 :product_id 256}]}
:applications {:emacs-mode-disable-app [ "^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^net\\.sf\\.cord$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.itap-mobile\\.qmote$",
"^com\\.nulana\\.remotixmac$",
"^com\\.p5sys\\.jump\\.mac\\.viewer$",
"^com\\.p5sys\\.jump\\.mac\\.viewer\\.web$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$",
"^com\\.2X\\.Client\\.Mac$",
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyperterm$",
"^co\\.zeit\\.hyper$",
"^io\\.alacritty$",
"^net\\.kovidgoyal\\.kitty$",
"^org\\.vim\\.",
"^com\\.qvacua\\.VimR$",
"^com\\.vmware\\.fusion$",
"^com\\.vmware\\.horizon$",
"^com\\.vmware\\.view$",
"^com\\.parallels\\.desktop$",
"^com\\.parallels\\.vm$",
"^com\\.parallels\\.desktop\\.console$",
"^org\\.virtualbox\\.app\\.VirtualBoxVM$",
"^com\\.vmware\\.proxyApp\\.",
"^com\\.parallels\\.winapp\\.",
"^org\\.x\\.X11$",
"^com\\.apple\\.x11$",
"^org\\.macosforge\\.xquartz\\.X11$",
"^org\\.macports\\.X11$",
"^com\\.sublimetext\\.",
"^com\\.microsoft\\.VSCode$"]
:Emacs ["^org\\.gnu\\.Emacs$"
"^org\\.gnu\\.AquamacsEmacs$"
"^org\\.gnu\\.Aquamacs$"]
:Chromes ["^com\\.google\\.Chrome$", "^org\\.chromium\\.Chromium$", "^com\\.google\\.Chrome\\.canary$"]
:Terminals ["^com\\.apple\\.Terminal$"
"^com\\.googlecode\\.iterm2$"
"^co\\.zeit\\.hyperterm$"
"^co\\.zeit\\.hyper$"
"^io\\.alacritty$"
"^net\\.kovidgoyal\\.kitty$"]
:vim-mode-disabled-application ["^com\\.apple\\.Terminal$"
"^com\\.googlecode\\.iterm2$"
"^co\\.zeit\\.hyperterm$"
"^co\\.zeit\\.hyper$"
"^io\\.alacritty$"
"^net\\.kovidgoyal\\.kitty$"
"^org\\.vim\\."
"^com\\.qvacua\\.VimR$"]
:Finder ["^com\\.apple\\.finder$"]
:Browsers ["^org\\.mozilla\\.firefox$"
"^com\\.google\\.Chrome$"
"^com\\.google\\.Chrome\\.canary$"
"^com\\.apple\\.Safari$"]
:2do ["^com\\.guidedways\\.TodoMac.*"]}
:input-sources {:squirrel {:input_mode_id "com.googlecode.rimeime.inputmethod.Squirrel"
:input_source_id "com.googlecode.rimeime.inputmethod.Squirrel.Rime"
:language "zh-Hans"}
:us {:input_mode_id ""
:input_source_id "com.apple.keylayout.US"
:language "en"}}}