about summary refs log tree commit diff stats
path: root/home-manager/config/lf/cmds/open.sh
blob: 8376be2145fffe6f9d6496bf92c2a7331db41f0a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
# shellcheck disable=SC2086
# shellcheck source=/dev/null
. ~/.local/lib/shell/lib


case $(file --mime-type "$f" -bL) in
    text/*|application/json) $EDITOR "$f";;
    image/*) $IVIEWER "$f";;
    *) xdg-open "$f" ;;
esac




if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi