You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
385 B

  1. #!/bin/sh
  2. set -e
  3. if [ -n "$DISPLAY" ]; then
  4. export FIFO_UEBERZUG="${TMPDIR:-/tmp}/lf-ueberzug-$$"
  5. cleanup() {
  6. exec 3>&-
  7. rm "$FIFO_UEBERZUG"
  8. }
  9. mkfifo "$FIFO_UEBERZUG"
  10. ueberzug layer -s <"$FIFO_UEBERZUG" &
  11. exec 3>"$FIFO_UEBERZUG"
  12. trap cleanup EXIT
  13. if ! [ -d "$HOME/.cache/lf" ]; then
  14. mkdir -p "$HOME/.cache/lf"
  15. fi
  16. lf "$@" 3>&-
  17. else
  18. exec lf "$@"
  19. fi