aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2022-02-08 11:59:20 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2022-02-08 11:59:20 +0100
commit50d5e9122a0476103bed306b0769c040fb4e9f30 (patch)
tree09439a07d8355e463c59466a6a674aea649bc744 /bash
parentbce12f04227a77b61118162b34fa1263b5847232 (diff)
downloaddotfiles-50d5e9122a0476103bed306b0769c040fb4e9f30.tar.gz
bashboard highlights
Diffstat (limited to 'bash')
-rw-r--r--bash/board.bash17
1 files changed, 16 insertions, 1 deletions
diff --git a/bash/board.bash b/bash/board.bash
index 265255a..dfee05f 100644
--- a/bash/board.bash
+++ b/bash/board.bash
@@ -7,6 +7,9 @@ BB_PRUNE_DAYS=5
[ ! -d "$BB_HIST_DIR" ] && mkdir -p "$BB_HIST_DIR"
+BB_COLOR_HIGHLIGHT="\e[0;34m"
+BB_COLOR_RESET="\e[39m"
+
# format
# NUM EPOCH PATH
@@ -45,9 +48,21 @@ function bashboard {
cnt=0
while read -r line; do
+ local DIR BNAME DNAME
read -r BB_NUM BB_DATE BB_DIR <<< "$line"
+
# Trailing / in $HOME
- echo "[$cnt] ${BB_DIR##$HOME}"
+ DIR="${BB_DIR##"$HOME"}"
+ BNAME="$(basename "$DIR")"
+ DNAME="$(dirname "$DIR")"
+
+ if [ "$DNAME" = "." ]; then
+ DNAME=""
+ else
+ DNAME="$DNAME/"
+ fi
+
+ printf "[$cnt] $DNAME$BB_COLOR_HIGHLIGHT$BNAME$BB_COLOR_RESET\n"
BB_SHORTCUT+=("$BB_DIR")