add log file for lf

This commit is contained in:
Dan Anglin 2022-05-21 09:43:01 +01:00
parent 951379995b
commit 1f2bdb8ba9
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638
2 changed files with 4 additions and 1 deletions

View file

@ -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

View file

@ -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"