2020-05-16 18:03:24 +02:00

23 lines
410 B
Bash
Executable File

#!/usr/bin/env bash
# Run vifm with ueberzug support.
export FIFO_UEBERZUG="/tmp/vifm-ueberzug-${PPID}"
function cleanup {
rm "$FIFO_UEBERZUG" 2>/dev/null
pkill -P $$ 2>/dev/null
}
rm "$FIFO_UEBERZUG" 2>/dev/null
mkfifo "$FIFO_UEBERZUG"
trap cleanup EXIT
tail --follow "$FIFO_UEBERZUG" | ueberzug layer --silent --parser bash &
if [ -n "$1" ]; then
vifm $1 $2
else
vifm $(pwd) $(pwd)
fi
cleanup