2018-07-02 12:30:30 +02:00
|
|
|
hook global KakBegin .* %sh{
|
2018-06-23 07:55:38 +02:00
|
|
|
if [ "$TERM" = "xterm-kitty" ] && [ -z "$TMUX" ]; then
|
2018-06-19 11:39:45 +02:00
|
|
|
echo "
|
|
|
|
alias global new kitty-new
|
|
|
|
alias global focus kitty-focus
|
|
|
|
"
|
|
|
|
fi
|
2018-07-02 12:30:30 +02:00
|
|
|
}
|
2018-06-19 11:39:45 +02:00
|
|
|
|
2018-09-01 21:14:33 +02:00
|
|
|
define-command -docstring %{kitty-new [<command>]: create a new kak client for the current session
|
|
|
|
Optional arguments are passed as arguments to the new client} \
|
|
|
|
-params .. \
|
|
|
|
-command-completion \
|
|
|
|
kitty-new %{ nop %sh{
|
|
|
|
kitty @ new-window --no-response "$(command -v kak 2>/dev/null)" -c "${kak_session}" -e "$*"
|
|
|
|
}}
|
2018-06-19 11:39:45 +02:00
|
|
|
|
|
|
|
define-command -params ..1 -client-completion \
|
|
|
|
-docstring %{kitty-focus [<client>]: focus the given client
|
|
|
|
If no client is passed then the current one is used} \
|
|
|
|
kitty-focus %{ evaluate-commands %sh{
|
|
|
|
if [ $# -eq 1 ]; then
|
|
|
|
printf %s\\n "evaluate-commands -client '$1' focus"
|
|
|
|
else
|
2018-09-01 21:14:33 +02:00
|
|
|
kitty @ focus-window --no-response -m=id:$kak_client_env_KITTY_WINDOW_ID
|
2018-06-19 11:39:45 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|