feat: more lf updates
parent
63c45fab32
commit
80bbb3d24b
|
@ -11,6 +11,19 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
previewer.source = pv;
|
previewer.source = pv;
|
||||||
settings.icons = true;
|
settings.icons = true;
|
||||||
|
commands = {
|
||||||
|
get-mime-type = ''%xdg-mime query filetype "$f"'';
|
||||||
|
open = ''
|
||||||
|
''${{
|
||||||
|
test -L $f && f=$(readlink -f $f)
|
||||||
|
case $(file --mime-type $f -b) in
|
||||||
|
text/*) vi $fx;;
|
||||||
|
application/json) vi $fx;;
|
||||||
|
*) for f in $fx; do xdg-open $f > /dev/null 2> /dev/null & done;;
|
||||||
|
esac
|
||||||
|
}}
|
||||||
|
'';
|
||||||
|
};
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
set cleaner ${cleaner}
|
set cleaner ${cleaner}
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -52,7 +52,7 @@ in pkgs.writeShellScript "pv.sh" ''
|
||||||
*/pdf) pdf "$1" "$2" "$3" "$4" "$5" ;;
|
*/pdf) pdf "$1" "$2" "$3" "$4" "$5" ;;
|
||||||
text/html) ${lynx} -width="$4" -display_charset=utf-8 -dump "$1" ;;
|
text/html) ${lynx} -width="$4" -display_charset=utf-8 -dump "$1" ;;
|
||||||
text/troff) ${man} ./ "$1" | ${col} -b ;;
|
text/troff) ${man} ./ "$1" | ${col} -b ;;
|
||||||
text/* | */xml) ${bat} --terminal-width "$4" -f "$1" ;;
|
text/* | */xml | application/json) ${bat} --terminal-width "$4" -f "$1" ;;
|
||||||
application/zip) ${atool} --list -- "$1" ;;
|
application/zip) ${atool} --list -- "$1" ;;
|
||||||
*opendocument*) ${odt2txt} "$1" ;;
|
*opendocument*) ${odt2txt} "$1" ;;
|
||||||
audio/* | application/octet-stream) ${mediainfo} "$1" || exit 1 ;;
|
audio/* | application/octet-stream) ${mediainfo} "$1" || exit 1 ;;
|
||||||
|
|
|
@ -94,6 +94,16 @@
|
||||||
source "''${VENV_DIR}/''${selected_env}/bin/activate"
|
source "''${VENV_DIR}/''${selected_env}/bin/activate"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lf () {
|
||||||
|
tmp=$(mktemp)
|
||||||
|
lf-wrapper -last-dir-path="$tmp" "$@"
|
||||||
|
if [ -f "$tmp" ]; then
|
||||||
|
dir=$(cat "$tmp")
|
||||||
|
rm -f "$tmp"
|
||||||
|
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
export LANG=en_US.utf8
|
export LANG=en_US.utf8
|
||||||
export LC_ALL=en_US.UTF-8
|
export LC_ALL=en_US.UTF-8
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in New Issue