;; command shorthand: https://github.com/yqrashawn/GokuRakuJoudo/blob/master/tutorial.md#command-a-to-control-1
; unlikely to be followed by alphanumeric characters
:period-mode {:key :period}
; :comma-mode {:key :comma}
; :quote-mode {:key :quote}
; :hyphen-mode {:key :hyphen}
;; :semicolon-mode {:key :semicolon}
; likely to be followed by alphanumeric characters
;; :backtick-mode {:key :grave_accent_and_tilde}
;; :slash-mode {:key :slash} ;; often used for in-page search
:templates {:launch "osascript -e 'tell application \"%s\" to activate'",
;; :displayplacer "displayplacer 'id:44402D57-1A3C-4E17-B021-A62AE68A07A0 res:\"%s\" hz:60 color_depth:8 enabled:true scaling:on origin:(0,0) degree:0'",
:open-in-arc "osascript -e ' tell application \"Arc\"\nactivate\ntell front window\nmake new tab with properties {URL:\"%s\"}\nend tell\nend tell'",}
; TODO: currently setting caps_lock to control in the GUI. could be nice to have it ALL in here.
; {:des "HOLD: - => ^" :rules [[:##hyphen :right_control nil {:alone :hyphen}]]}
; {:des "HOLD: spacebar => ⌘)" :rules [[:##spacebar :right_command nil {:alone :spacebar}]]}
; {:des "HOLD: tab => ✦" :rules [[:##tab :!QWEright_shift nil {:alone :tab}]]}
{:des "spacebar (held) => ⌥R)" :rules [[:##spacebar :right_option nil {:alone :spacebar}]]}
{:des "⌘L (tap) => delete" :rules [[:##left_command :left_command nil {:alone :delete_or_backspace}]]}
{:des "⌘R (tap) => return" :rules [[:##right_command :right_command nil {:alone :return_or_enter}]]}
; {:des "⇧L (tap) => escape" :rules [[:##left_shift :left_shift nil {:alone :escape}]]}
; {:des "⇧R (tap) => return" :rules [[:##right_shift :right_shift nil {:alone :return_or_enter}]]}
{:des "^L (tap) => escape" :rules [[:##left_control :left_control nil {:alone :escape}]]} ; remapped to caps_lock in UI for positional parity with :hyphen. and to potentiall add symmetry to /\ (on smaller keyboards, when chording)
; {:des "= (held) ^L" :rules [[:##equal_sign :left_control nil {:alone :equal_sign}]]} ; remapped to caps_lock in UI for positional parity with :hyphen. and to potentiall add symmetry to /\ (on smaller keyboards, when chording)
{:des "- (held) ^R" :rules [[:##hyphen :right_control nil {:alone :hyphen}]]}
; {:des "TAP/HOLD: ⇪ => esc/^" :rules [[:##caps_lock :left_control nil {:alone :escape}]]}
; simulate thumb clusters with ⌘ key
; these really craete more problems than they solve. i'm regularly deleting things (unwittingly) when command-tabbing.
; additionally, the thumb positions just aren't as nice as with legit thumb clusters.
; i'd leave this as a physical-keyboard-only improvement.
;; {:des "R⌘ > RETURN (when tapped)" :rules [[:##right_command :right_command nil {:alone :##return_or_enter}]]}
;; {:des "L⌘ > DELETE (when tapped)" :rules [[:##left_command :left_command nil {:alone :##delete_or_backspace}]]}
; app launcher/switcher layer
; right-hand characters (mnemonic)
[:c [:launch "Calendar"]]
[:l [:launch "Superhuman"]]
[:m [:launch "Messages"]]
[:t [:launch "Alacritty"]]
[:v [:launch "Visual Studio Code"]]
[:open_bracket [:!CStab]]
[:close_bracket [:!Ctab]]
; [:backslash [:launch ""]]
; [:equal_sign [:launch ""]]
;{:des "1 > L⇧ (when held)" :rules [[:##1 :left_shift nil {:alone :1}]]}
;{:des "2 > L⌥ (when held)" :rules [[:##2 :left_option nil {:alone :2}]]}
;{:des "3 > L^ (when held)" :rules [[:##3 :left_control nil {:alone :3}]]}
;{:des "4 > L⌘ (when held)" :rules [[:##4 :left_command nil {:alone :4}]]}
;{:des "7 > R⌘ (when held)" :rules [[:##7 :right_command nil {:alone :7}]]}
;{:des "8 > R^ (when held)" :rules [[:##8 :right_control nil {:alone :8}]]}
;{:des "9 > R⌥ (when held)" :rules [[:##9 :right_option nil {:alone :9}]]}
;{:des "0 > R⇧ (when held)" :rules [[:##0 :right_shift nil {:alone :0}]]}
;; {:des "semicolon mode"
;; :rules [:semicolon-mode
;; [:n [:!TOright_arrow]]
;; [:return_or_enter [:!TOreturn_or_enter]]
; {:des "quote mode" ; 10-key mode
; [:right_command :keypad_0]
; [:right_option :keypad_period]
; [:return_or_enter :keypad_equal_sign]
; ; keypad_enter, keypad_comma
; [:c [:open "~/.config -a 'Visual Studio Code'"]]
; [:d [:open "~/Desktop -a 'Finder'"]]
; [:l [:open "~/Downloads -a 'Finder'"]]
; [:s [:open "~/sites/chan.dev -a 'Visual Studio Code'"]]
; [:7 [:open "~/Desktop -a 'Finder'"]]
; [:8 [:open "~/Downloads -a 'Finder'"]]
; [:9 [:open "~/Documents -a 'Finder'"]]
; [:0 [:open "~ -a 'Finder'"]]
; [:1 [:open-in-arc "http://localhost:1234"]]
; [:2 [:open-in-arc "http://localhost:2426"]]
; [:3 [:open-in-arc "http://localhost:3000"]]
; [:4 [:open-in-arc "http://localhost:4321"]]
; [:5 [:open-in-arc "http://localhost:5173"]]
; [:x [:open-in-arc "https://x.com/notifications/mentions"]] ; add an open in profile option
; [:y [:open-in-arc "https://youtube.com"]]
; [:6 [:open-in-arc "http://localhost:6006"]]
; [:7 [:open-in-arc "http://localhost:7890"]]
; [:8 [:open-in-arc "http://localhost:8080"]]
; [:9 [:open-in-arc "http://localhost:9000"]]
; [:g [:open-in-arc "https://github.com"]]
; [:h [:open-in-arc "https://chan.dev"]]
; [:s [:open-in-arc "https://studio.youtube.com"]]
;; [:1 [:displayplacer "2560x1440"]]
;; [:2 [:displayplacer "1920x1080"]]]}
;; :rules [[:c [:launch "Calendar"] :period-mode]
;; [:b [:launch "Google Chrome"] :period-mode]
;; [:m [:launch "Messages"] :period-mode]]}