AutoYADM commit: 2025-05-29 19:05:14
This commit is contained in:
parent
255bc2dc76
commit
863add8fd8
1 changed files with 13 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
|||
# TODO: make the operation async!
|
||||
# Is there something we can do with global vs. window scoped title?
|
||||
declare-option bool bar_debug false
|
||||
declare-option -docstring %{
|
||||
Format string passed to printf for the bufferlist.
|
||||
It should be set in the global scope.
|
||||
|
@ -39,6 +40,9 @@ declare-option -docstring %{
|
|||
define-command -hidden bar-buflist %{
|
||||
nop %sh{
|
||||
{
|
||||
if [ -z "$kak_client" ]; then
|
||||
exit
|
||||
fi
|
||||
list=''
|
||||
index=0
|
||||
while read buf; do
|
||||
|
@ -63,13 +67,18 @@ EOF
|
|||
|
||||
title="$list - $kak_client@[$kak_session]"
|
||||
# printf "eval -verbatim set-option -add window ui_options %%{terminal_title=%s}" "$title" | kak -p ${kak_session}
|
||||
printf "eval -try-client '$kak_client' -verbatim set-option -add global ui_options %%{terminal_title=%s}" "$title" | kak -p ${kak_session}
|
||||
printf "eval -verbatim try %%{ exec -try-client '$kak_client' <c-l> }" | kak -p ${kak_session}
|
||||
# printf "echo -debug -- eval -try-client '$kak_client' -verbatim set-option -add global ui_options %%{terminal_title=%s}; exec -try-client '$kak_client' <c-l>" "$title" | kak -p ${kak_session}
|
||||
title_cmd=$(printf "eval -try-client '$kak_client' -verbatim set-option -add global ui_options %%{terminal_title=%s}" "$title")
|
||||
echo "$title_cmd" | kak -p ${kak_session}
|
||||
refresh_cmd=$(printf "eval -verbatim try %%{ exec -try-client '$kak_client' <c-l> }")
|
||||
echo "$refresh_cmd" | kak -p ${kak_session}
|
||||
if [ "$kak_opt_bar_debug" = "true" ]; then
|
||||
printf 'echo -debug -- %s' "$title_cmd" | kak -p ${kak_session}
|
||||
printf 'echo -debug -- %s' "$refresh_cmd" | kak -p ${kak_session}
|
||||
fi
|
||||
} > /dev/null 2>&1 < /dev/null &
|
||||
}
|
||||
}
|
||||
|
||||
set global bar_debug true
|
||||
hook global WinDisplay .* bar-buflist
|
||||
hook global FocusIn .* bar-buflist
|
||||
# hook global FocusOut .* bar-buflist
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue