From 1f2bdb8ba99002d0db946d360e4dd727ae53e194 Mon Sep 17 00:00:00 2001 From: Dan Anglin Date: Sat, 21 May 2022 09:43:01 +0100 Subject: [PATCH] add log file for lf --- config/bash/bashrc | 1 + config/bash/bashrc.d/lf | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config/bash/bashrc b/config/bash/bashrc index 6ff0a19..0ee79bf 100644 --- a/config/bash/bashrc +++ b/config/bash/bashrc @@ -15,6 +15,7 @@ export XDG_CONFIG_HOME=${HOME}/.local/config export XDG_DATA_HOME=${HOME}/.local/share export XDG_CACHE_HOME=${HOME}/.local/cache export XDG_STATE_HOME=${HOME}/.local/state +export LOG_HOME="${XDG_STATE_HOME}/logs" # == load all enabled scripts in ~/.bashrc.d # == any scripts with the .disabled extension won't be loaded diff --git a/config/bash/bashrc.d/lf b/config/bash/bashrc.d/lf index 2945ea5..4af8efc 100644 --- a/config/bash/bashrc.d/lf +++ b/config/bash/bashrc.d/lf @@ -2,8 +2,10 @@ lf () { tmp="$(mktemp)" + + logpath="${LOG_HOME}/lf.log" - command lf --last-dir-path="$tmp" "$@" + command lf --last-dir-path="$tmp" --log="$logpath" "$@" if [ -f "$tmp" ]; then dir="$(cat "$tmp")" rm -f "$tmp"