diff --git a/.config/ranger/scope.sh b/.config/ranger/scope.sh index 7493461b..ff755f93 100755 --- a/.config/ranger/scope.sh +++ b/.config/ranger/scope.sh @@ -82,9 +82,18 @@ case "$mimetype" in # FIXME: does not work! # highlight --out-format=xterm256 -s zmrok "$path" | head -n $maxln success && exit 5 || exit 2;; - # Ascii-previews of images: + + # CUSTOM image/*) - img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;; + ## Ascii-previews of images: + # img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;; + ## Use sed to remove spaces so the output fits into the narrow window + if have mediainfo; then + mediainfo "$path" | sed 's/ \+:/: /;' + success && exit 5 + fi + exit 1;; + # Display information about media files: video/* | audio/*) have exiftool && exiftool "$path" && exit 5 diff --git a/.shell.d/funs_rc b/.shell.d/funs_rc index dad02b05..0b726e18 100644 --- a/.shell.d/funs_rc +++ b/.shell.d/funs_rc @@ -920,25 +920,19 @@ formatc() ## TeXlive if [ -d "/usr/local/texlive" ]; then - ## WARNING: it is important to set umask properly, otherwise users might ## not have authorization to use the packages. - ## TODO: It is dirty to invoke a subshell several times. - ## Would be better to pass one parameter, then to tokenize it. + ## This is bad pratice to write args without double quotes, but since we + ## are sure there is no space in TeX Live packages, it is OK here. tli () { - for i ; do - sudo sh -c 'umask 022 && tlmgr install "$0"' "$i" - done + sudo sh -c 'umask 022 && tlmgr install $0 $@' "$@" } tlr () { - for i ; do - sudo sh -c 'umask 022 && tlmgr remove "$0"' "$i" - done + sudo sh -c 'umask 022 && tlmgr remove $0 $@' "$@" } - fi diff --git a/.shell.d/main_rc b/.shell.d/main_rc index 768ff706..a7979be8 100644 --- a/.shell.d/main_rc +++ b/.shell.d/main_rc @@ -45,6 +45,7 @@ fi ## Terminal ## WARNING: this is always a bad idea! +## FreeBSD urxvt $TERM variable is not set properly for some reasons. ## TODO: check how to do this properly. if [ ! "$OSTYPE" = "linux-gnu" ] && [[ "$TERM" = *rxvt* ]]; then export TERM="rxvt-unicode-256color"