From 54bda398a45f3f76f9ae3e3dc97e6a08aeee7fb0 Mon Sep 17 00:00:00 2001 From: Luca Bilke <bilke@tralios.de> Date: Mon, 1 Aug 2022 14:30:07 +0200 Subject: [PATCH] change tab name to working directory on cd and exit in lf --- .config/lf/lfrc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 6e49c858..41f464bf 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -1,6 +1,5 @@ -set ratios 1:2:4 - # Basic vars +set ratios 1:2:4 set shellopts '-eu' set ifs "\n" set scrolloff 10 @@ -135,7 +134,11 @@ cmd git_branch ${{ lf -remote "send $id cd \"$pwd_shell\"" }} + + cmd on-cd &{{ + DIR=$(echo $PWD | sed "s|$HOME|~|") + printf "\033]0; $DIR\007" > /dev/tty # display git repository status in your prompt source /usr/share/git/completion/git-prompt.sh GIT_PS1_SHOWDIRTYSTATE=auto @@ -147,6 +150,13 @@ cmd on-cd &{{ fmt="\033[32;1m%u@%h\033[0m:\033[34;1m%w\033[0m\033[33;1m$git\033[0m" lf -remote "send $id set promptfmt \"$fmt\"" }} +# run at startup +on-cd + +cmd on-quit ${{ + DIR=$(echo $PWD | sed "s|$HOME|~|") + printf "\033]0; $DIR\007" > /dev/tty +}} cmd paste &{{ set -- $(cat ~/.local/share/lf/files)