2023-06-13 16:09:53 +02:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
2024-04-18 11:13:07 +02:00
|
|
|
# clean() {
|
|
|
|
# exec 3>&-
|
|
|
|
# rm "$FIFO_UEBERZUG"
|
|
|
|
# }
|
2023-06-13 16:09:53 +02:00
|
|
|
|
|
|
|
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
|
2024-04-18 11:13:07 +02:00
|
|
|
command lf "$@"
|
2023-06-13 16:09:53 +02:00
|
|
|
else
|
2024-04-18 11:13:07 +02:00
|
|
|
[ ! -d "$HOME/.cache/lf" ] && mkdir --parents "$HOME/.cache/lf"
|
|
|
|
# export FIFO_UEBERZUG="$XDG_RUNTIME_DIR/ueberzug-$$"
|
|
|
|
# mkfifo "$FIFO_UEBERZUG"
|
|
|
|
# ueberzug layer -s -p json <"$FIFO_UEBERZUG" &
|
|
|
|
# exec 3>"$FIFO_UEBERZUG"
|
|
|
|
# trap clean EXIT
|
|
|
|
command lf "$@" 3>&-
|
2023-06-13 16:09:53 +02:00
|
|
|
fi
|