From 5e94923318f3a97419bf6093a923567f32623331 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 1 Jun 2026 00:03:27 +0200 Subject: pkgs/ll: Stop generating uncountable amount of tmpfiles --- modules/by-name/lf/lf/wrappers/ll/ll.sh | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'modules/by-name/lf') diff --git a/modules/by-name/lf/lf/wrappers/ll/ll.sh b/modules/by-name/lf/lf/wrappers/ll/ll.sh index ce29fd97..9bb314c6 100755 --- a/modules/by-name/lf/lf/wrappers/ll/ll.sh +++ b/modules/by-name/lf/lf/wrappers/ll/ll.sh @@ -10,20 +10,14 @@ # You should have received a copy of the License along with this program. # If not, see . -last_directory="$(mktemp -t ll_last_directory_XXXXXXX)" -cleanup() { - rm "$last_directory" -} -trap cleanup EXIT +[ -d "$XDG_RUNTIME_DIR/ll" ] || mkdir "$XDG_RUNTIME_DIR/ll" +last_directory="$XDG_RUNTIME_DIR/ll/last_directory" command lf -last-dir-path="$last_directory" "$@" dir="$(cat "$last_directory")" -if cd "$dir"; then - [ -d "$XDG_RUNTIME_DIR/ll" ] || mkdir "$XDG_RUNTIME_DIR/ll" - echo "$dir" >"$XDG_RUNTIME_DIR/ll/last_directory" -else - die "$dir does not exist!" +if ! cd "$dir"; then + die "ll: Failed to cd to '$dir'. Does it exist?" fi # vim: ft=sh -- cgit v1.3.1