From 4663e4d326450af70ab827ba458f964a11faaff1 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 8 Nov 2023 16:12:12 -0500 Subject: [PATCH] minor improvements --- brc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/brc b/brc index d54570e..49c9a26 100644 --- a/brc +++ b/brc @@ -301,9 +301,8 @@ mysrc /a/bin/distro-functions/src/package-manager-abstractions # * functions -### begin FSF section ### -# use for temporary functions +# temporary functions y() { m "${@//spring/fall}" } @@ -312,6 +311,8 @@ h() { } +### begin FSF section ### + # Comments before functions are meant to be good useful # documentation. If they fail at that, please improve them or send Ian a # note. @@ -335,10 +336,10 @@ ccomp() { eval $c $* } -## directory history tracking and navigation. +## BEGIN directory history tracking and navigation. # -# cd becomes a function, also aliased to c. b to go back, f to go -# forward, cl to list recent directories and choose one. +# use c instead of cd (could alias to cd if you wanted). b to go back, f +# to go forward, cl to list recent directories and choose one. # # The finer details you may want to skip: # @@ -477,7 +478,9 @@ cl() { alines[$line]=t buttondirs[${buttons[i]}]="$line" printf "%s %s\n" ${buttons[i]} "$line" - if (( i == ${#buttons[@]} - 1 )); then + # the LINES bit is for when we have a short terminal, just dont print all + # the directories. alternative would be to do something like less the list. + if (( i == ${#buttons[@]} - 1 )) || { [[ $LINES ]] && (( i == LINES - 3 )); }; then break fi i=$(( i + 1 )) @@ -492,7 +495,8 @@ cl() { c "${buttondirs[$input]}" fi } -# back list +# list the back and forward directories. i tend to forget this exists +# and use cl instead. bl() { local start i j max max=10 @@ -2787,6 +2791,7 @@ rn() { } n() { dunstify -u critical n + _psrun=(dunstctl close-all) } catnew() { -- 2.30.2