From ccbb680ce500073c1c4f866f9e28f807e354ac2c Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 21 Oct 2018 12:58:51 +1100 Subject: more color --- README.md | 3 +++ fff | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 27163a0..04cadd7 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,9 @@ export FFF_COL1=2 # Status color [0-9] export FFF_COL2=7 +# Selection color [0-9] (copied/moved files) +export FFF_COL3=6 + # Text Editor export EDITOR="cmd" ``` diff --git a/fff b/fff index 402aada..b9567bf 100755 --- a/fff +++ b/fff @@ -21,10 +21,10 @@ f_print() { c="${#f[@]}" for((i=${k:=0};i<(j=j>c?c:j);i++));{ ((c<=0)) && { get_dir; f_print; return; } || path="${f[i]##*/}" - [[ -d "${f[i]}" ]] && path="\\e[1m\\e[3${FFF_COL1:-2}m${path}/\\e[m" - [[ "${f[i]}" == "${f[l]}" ]] && path="\\e[7m${path}\\e[m" - [[ "$co" == "${f[i]}" ]] && path="\\e[1m\\e[38m\\e[7m${f[i]}\\e[m" - printf '\e[K%b\n' "$path" + [[ -d ${f[i]} ]] && path="\\e[1m\\e[3${FFF_COL1:-2}m${path}/" + [[ ${f[i]} == "${f[l]}" ]] && path="\\e[7m${path}" + [[ $co == "${f[i]}" ]] && path="\\e[1m\\e[3${FFF_COL3:-6}m\\e[7m${f[i]}" + printf '\e[K%b\e[m\n' "$path" } printf '\e[3%sm\e[%s;H\e[K\n\e[K%b\e[m\e[H' "${FFF_COL2:-7}" "$((LINES-2))" \ "${PWD/\/\//\/} (${l:-1}/$((c-1))) ${co:+${pr[*]}: ${co##*/} [p]}" -- cgit v1.2.3