From 635b2455612569c96979a4faddef5cfdf82ab35c Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Thu, 29 May 2025 23:42:43 -0400 Subject: [PATCH] AutoYADM commit: 2025-05-29 23:42:43 --- .config/kak/autoload/title-bar.kak | 88 +---------------------------- .config/kak/autoload/title-bar.kak_ | 87 ++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 87 deletions(-) mode change 100644 => 120000 .config/kak/autoload/title-bar.kak create mode 100644 .config/kak/autoload/title-bar.kak_ diff --git a/.config/kak/autoload/title-bar.kak b/.config/kak/autoload/title-bar.kak deleted file mode 100644 index afeaa0b9..00000000 --- a/.config/kak/autoload/title-bar.kak +++ /dev/null @@ -1,87 +0,0 @@ -provide-module title-bar %~ -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. - - It receives two string arguments, where the first is the buffer index, - and the second is the buffer name. - - Default: '[%s %s]' -} str bar_active_fmt '[%s %s]' -declare-option -docstring %{ - Format string passed to printf for the bufferlist. - It should be set in the global scope. - - It receives two string arguments, where the first is the buffer index, - and the second is the buffer name. - - Default: '[%s %s]+' -} str bar_active_modified_fmt '[%s %s]+' -declare-option -docstring %{ - Format string passed to printf for the bufferlist. - It should be set in the global scope. - - It receives two string arguments, where the first is the buffer index, - and the second is the buffer name. - - Default: '%s %s' -} str bar_inactive_fmt '%s %s' -# declare-option -docstring %{ -# Format string passed to printf for the bufferlist. -# It should be set in the global scope. - -# It receives two string arguments, where the first is the buffer index, -# and the second is the buffer name. - -# Default: '%s %s+' -# } str bar_inactive_modified_fmt '%s %s+' -define-command -hidden bar-buflist %{ - nop %sh{ - { - if [ -z "$kak_client" ]; then - exit - fi - list='' - index=0 -while read buf; do - if [ "$buf" = '*debug*' ]; then - continue - fi - index=$((index + 1)) - if [ "$buf" = "$kak_bufname" ]; then - if [ "$kak_modified" = "true" ]; then - cur=$(printf "$kak_opt_bar_active_modified_fmt" "$index" "$buf") - else - cur=$(printf "$kak_opt_bar_active_fmt" "$index" "$buf") - fi - else - cur=$(printf "$kak_opt_bar_inactive_fmt" "$index" "$buf") - fi - list="$list $cur" -done < }") - 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 & - } -} -hook global WinCreate .* bar-buflist -hook global WinClose .* bar-buflist -hook global WinDisplay .* bar-buflist -hook global BufCreate .* bar-buflist -hook global FocusIn .* bar-buflist -~ - diff --git a/.config/kak/autoload/title-bar.kak b/.config/kak/autoload/title-bar.kak new file mode 120000 index 00000000..ba6cdb50 --- /dev/null +++ b/.config/kak/autoload/title-bar.kak @@ -0,0 +1 @@ +/home/fic/dev/kak-title-bar/rc/title-bar.kak \ No newline at end of file diff --git a/.config/kak/autoload/title-bar.kak_ b/.config/kak/autoload/title-bar.kak_ new file mode 100644 index 00000000..afeaa0b9 --- /dev/null +++ b/.config/kak/autoload/title-bar.kak_ @@ -0,0 +1,87 @@ +provide-module title-bar %~ +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. + + It receives two string arguments, where the first is the buffer index, + and the second is the buffer name. + + Default: '[%s %s]' +} str bar_active_fmt '[%s %s]' +declare-option -docstring %{ + Format string passed to printf for the bufferlist. + It should be set in the global scope. + + It receives two string arguments, where the first is the buffer index, + and the second is the buffer name. + + Default: '[%s %s]+' +} str bar_active_modified_fmt '[%s %s]+' +declare-option -docstring %{ + Format string passed to printf for the bufferlist. + It should be set in the global scope. + + It receives two string arguments, where the first is the buffer index, + and the second is the buffer name. + + Default: '%s %s' +} str bar_inactive_fmt '%s %s' +# declare-option -docstring %{ +# Format string passed to printf for the bufferlist. +# It should be set in the global scope. + +# It receives two string arguments, where the first is the buffer index, +# and the second is the buffer name. + +# Default: '%s %s+' +# } str bar_inactive_modified_fmt '%s %s+' +define-command -hidden bar-buflist %{ + nop %sh{ + { + if [ -z "$kak_client" ]; then + exit + fi + list='' + index=0 +while read buf; do + if [ "$buf" = '*debug*' ]; then + continue + fi + index=$((index + 1)) + if [ "$buf" = "$kak_bufname" ]; then + if [ "$kak_modified" = "true" ]; then + cur=$(printf "$kak_opt_bar_active_modified_fmt" "$index" "$buf") + else + cur=$(printf "$kak_opt_bar_active_fmt" "$index" "$buf") + fi + else + cur=$(printf "$kak_opt_bar_inactive_fmt" "$index" "$buf") + fi + list="$list $cur" +done < }") + 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 & + } +} +hook global WinCreate .* bar-buflist +hook global WinClose .* bar-buflist +hook global WinDisplay .* bar-buflist +hook global BufCreate .* bar-buflist +hook global FocusIn .* bar-buflist +~ +