From d0bbbfee2766f8411800f390d1c6ce0c6eaa6346 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Tue, 12 Nov 2013 17:03:57 +0100 Subject: [PATCH] Ranger: various enhancements --- .config/ranger/rc.conf | 8 ++++---- .config/ranger/rifle.conf | 5 +++-- .config/ranger/scope.sh | 4 ++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf index 831011e0..ffc8b8e1 100644 --- a/.config/ranger/rc.conf +++ b/.config/ranger/rc.conf @@ -98,7 +98,7 @@ map ! console shell -w # For the nostalgics: Midnight Commander bindings map bulkrename -map console shell -w file "%f" +map shell -w file %s map console touch map console mkcd @@ -117,9 +117,9 @@ map Q quit map DD shell trash-put -- %s ## Extraction using atools. -map exs shell aunpack -e %s -map exg shell aunpack -e %s -X "$HOME/games/" -map exh extracthere +map ex shell -w aunpack -e %s +map eXg shell -w aunpack -e %s -X "$HOME/games/" +map eXh extracthere ## Git map ega shell -w git add %f %s diff --git a/.config/ranger/rifle.conf b/.config/ranger/rifle.conf index 0d60edda..9aa9e1ed 100644 --- a/.config/ranger/rifle.conf +++ b/.config/ranger/rifle.conf @@ -161,14 +161,15 @@ ext pdf, has evince, X, flag f = evince -- "$@" ext pdf, has okular, X, flag f = okular -- "$@" ext pdf, has epdfview, X, flag f = epdfview -- "$@" -ext docx?, has catdoc, terminal = catdoc -- "$@" | "$PAGER" - ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric, X, flag f = gnumeric -- "$@" ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has kspread, X, flag f = kspread -- "$@" ext od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@" ext od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has soffice, X, flag f = soffice "$@" ext od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has ooffice, X, flag f = ooffice "$@" +ext docx?, has docx2txt.pl, terminal = docx2txt.pl "$@" - | "$PAGER" +ext docx?, has catdoc, terminal = catdoc "$@" | "$PAGER" + ext djvu, has zathura, X, flag f = zathura -- "$@" ext djvu, has evince, X, flag f = evince -- "$@" diff --git a/.config/ranger/scope.sh b/.config/ranger/scope.sh index bcd6294e..d384a5fa 100755 --- a/.config/ranger/scope.sh +++ b/.config/ranger/scope.sh @@ -76,6 +76,10 @@ case "$extension" in try mediainfo "$path" && { dump | sed 's/ \+:/: /;' | trim | fmt -s -w $width; exit 4; } ;; doc) try antiword "$path" && { dump | trim | fmt -s -w $width; exit 0; } || exit 1;; + docx) + try docx2txt.pl "$path" - && { dump | trim | fmt -s -w $width; exit 0; } + try catdoc "$path" && { dump | trim | fmt -s -w $width; exit 0; } + exit 1;; rtf) try unrtf --text "$path" && { dump | trim | fmt -s -w $width; exit 0; } || exit 1;; odt)