kak and niri

This commit is contained in:
Charlie Root 2025-03-12 19:08:13 +01:00
commit a7b0020125
Signed by: faukah
SSH key fingerprint: SHA256:Uj2AXqvtdCA4hn5Hq0ZonhIAyUqI1q4w2sMG3Z1TH7E
3 changed files with 550 additions and 0 deletions

32
kak/tv/tv.kak Normal file
View file

@ -0,0 +1,32 @@
# define-command run-tv %{ evaluate-commands %sh{
# # Create a temporary fifo for communication
# tv_tmp="$(mktemp -d "${TMPDIR:-/tmp}"/tv.kak.XXXXXX)"
# tv_out="${tv_tmp}/tvcmd"
# result="${tv_tmp}/result"
# mkfifo ${tv_out}
# # run command detached from the shell
# { tv > ${tv_out} } > /dev/null 2>&1 < /dev/null &
# # Open the file in Kakoune and add a hook to remove the fifo
# echo "edit! -fifo ${tv_out} *buffer-name*
# hook buffer BufClose .* %{ nop %sh{ rm -r $(dirname ${tv_tmp})} }"
# }
# }
#
#
define-command bla %{ evaluate-commands %sh{
# Create a temporary fifo for communication
output=$(mktemp -d -t kak-temp-XXXXXXXX)/fifo
mkfifo ${output}
# run command detached from the shell
{ lazygit > ${output} } > /dev/null 2>&1 < /dev/null &
# Open the file in Kakoune and add a hook to remove the fifo
echo "edit! -fifo ${output} *buffer-name*
hook buffer BufClose .* %{ nop %sh{ rm -r $(dirname ${output})} }"
} }