aboutsummaryrefslogtreecommitdiff
path: root/.config/lf/lfrc
blob: cea084e1b633212c2dc7358642c3bea7ec39e3d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
set ifs "\n"
set sixel true
set cleaner ~/.config/lf/cleaner
set previewer ~/.config/lf/scope

cmd open ${{
  case $(file --mime-type "$(readlink -f $f)" -b) in
    text/*|application/json|inode/x-empty|application/x-subrip) $EDITOR $fx;;
    video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;;
    audio/*|video/x-ms-asf) mpv --audio-display=no $f ;;
    *) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;;
  esac
}}

cmd delete ${{
	clear; tput cup $(($(tput lines)/3)); tput bold
	set -f
	printf "%s\n\t" "$fx"
	printf "delete?[y/N]"
	read ans
	[ $ans = "y" ] && rm -rf -- $fx
}}

map D delete