1
0
Fork 0
dotfiles/.local/bin/lfX

20 lines
393 B
Plaintext
Raw Normal View History

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