Open jackielii opened 2 years ago
I managed to use mode to implement this, but an extra key is needed:
:: default : yabai -m config window_border off
:: forward @ : yabai -m config window_border on
cmd - x ; test
forward < cmd - 1 -> ; default
Ha, managed to hack it:
# ctrl + number forward as cmd + number to applications {{{
# _HACK_ to send ctrl + number as cmd + number to applications skipping existing mapping:
# 1. define default & capture mode, capture mode will capture all keypresses
:: default
:: capmode @
# 2. define a key I'll never use to switch to capture mode
fn - 1 ; capmode
# 3. define ctrl + number to send mode switch key, then send cmd + number
ctrl - 1 : skhd -k "fn - 1" ; skhd -k "cmd - 1"
ctrl - 2 : skhd -k "fn - 1" ; skhd -k "cmd - 2"
ctrl - 3 : skhd -k "fn - 1" ; skhd -k "cmd - 3"
ctrl - 4 : skhd -k "fn - 1" ; skhd -k "cmd - 4"
ctrl - 5 : skhd -k "fn - 1" ; skhd -k "cmd - 5"
ctrl - 6 : skhd -k "fn - 1" ; skhd -k "cmd - 6"
ctrl - 7 : skhd -k "fn - 1" ; skhd -k "cmd - 7"
ctrl - 8 : skhd -k "fn - 1" ; skhd -k "cmd - 8"
ctrl - 9 : skhd -k "fn - 1" ; skhd -k "cmd - 9"
# 4. make sure in capture mode, the cmd + number is passed through and back to default mode
capmode < cmd - 1 -> ; default
capmode < cmd - 2 -> ; default
capmode < cmd - 3 -> ; default
capmode < cmd - 4 -> ; default
capmode < cmd - 5 -> ; default
capmode < cmd - 6 -> ; default
capmode < cmd - 7 -> ; default
capmode < cmd - 8 -> ; default
capmode < cmd - 9 -> ; default
# }}}
got a simpler solution:
# 1. define default & capture mode
:: default
:: tabmode
# 2. define an impossible key to switch to capture mode
hyper - 0x80 ; tabmode
tabmode < hyper - 0x80 ; default
# 3. define ctrl + number to send mode switch key, send cmd + number, switch back
ctrl - 1 : skhd -k "hyper - 0x80" ; skhd -k "cmd - 1" ; skhd -k "hyper - 0x80"
ctrl - 2 : skhd -k "hyper - 0x80" ; skhd -k "cmd - 2" ; skhd -k "hyper - 0x80"
ctrl - 3 : skhd -k "hyper - 0x80" ; skhd -k "cmd - 3" ; skhd -k "hyper - 0x80"
ctrl - 4 : skhd -k "hyper - 0x80" ; skhd -k "cmd - 4" ; skhd -k "hyper - 0x80"
ctrl - 5 : skhd -k "hyper - 0x80" ; skhd -k "cmd - 5" ; skhd -k "hyper - 0x80"
ctrl - 6 : skhd -k "hyper - 0x80" ; skhd -k "cmd - 6" ; skhd -k "hyper - 0x80"
ctrl - 7 : skhd -k "hyper - 0x80" ; skhd -k "cmd - 7" ; skhd -k "hyper - 0x80"
ctrl - 8 : skhd -k "hyper - 0x80" ; skhd -k "cmd - 8" ; skhd -k "hyper - 0x80"
ctrl - 9 : skhd -k "hyper - 0x80" ; skhd -k "cmd - 9" ; skhd -k "hyper - 0x80"
I have the following config:
So I want to have
cmd - 1
to switch to 1st space, and usectrl - 1
ascmd - 1
in any applications but skhd or yabai. But it doesn't work as expected. I also tried the non forward version: