# sets set shell sh set shellopts '-eu' set ifs "\n" # cmds cmd open ${{ case $(file -bi $f) in text/troff) man ./ $f;; text/*) $EDITOR $fx;; image/x-xcf|image/svg+xml) gimp $f >/dev/null 2>&1 & ;; image/vnd.djvu|application/epub+zip|application/pdf) zathura $f >/dev/null 2>&1 & ;; image/*) sxiv -ai >/dev/null 2>&1 & ;; audio/*) mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) --quiet $f >/dev/null 2>&1 & ;; video/*) mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) $f ;; *) for f in $fx; do lh $f > /dev/null 2>&1 & done;; esac }} cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1 cmd delete ${{ set -f printf "%s\n\t" "$fx" printf "delete?[y/n]" read ans [ $ans = "y" ] && rm -rf $fx }} # binds map D delete map a push %mkdir map r push :rename map shell map R reload map x $$f map X !$f