feat: add lf snippet for bashrc

This commit is contained in:
NunoSempere 2023-02-12 13:44:53 +01:00
parent cca4385b18
commit 258073fb21
2 changed files with 22 additions and 1 deletions

16
lf-snippet.sh Normal file
View File

@ -0,0 +1,16 @@
## Exit on working directory for lf
lf () {
tmp="$(mktemp)"
_lf -last-dir-path="$tmp" "$@" --command "set hidden"
if [ -f "$tmp" ]; then
dir="$(cat "$tmp")"
rm -f "$tmp"
if [ -d "$dir" ]; then
if [ "$dir" != "$(pwd)" ]; then
cd "$dir"
fi
fi
fi
}

View File

@ -6,4 +6,9 @@ cd workspace
wget https://github.com/gokcehan/lf/releases/download/r28/lf-linux-amd64.tar.gz -O lf.tar.gz
tar -xzf lf.tar.gz
sudo mv lf /usr/bin/_lf
mkdir -p ~/.config
mkdir -p ~/.config/lf
cd ~/.config/lf
wget https://git.nunosempere.com/open.source/server-init/raw/branch/master/lfrc -O lfrc
cd ~
touch .bashrc
e