From 7afa24fc137884edd77925d10ab928cd1cc3adc0 Mon Sep 17 00:00:00 2001 From: Alexis Hovorka Date: Mon, 1 May 2023 14:11:41 -0600 Subject: [feat] Add reference bar to tmux --- base/tmux/status | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'base/tmux/status') diff --git a/base/tmux/status b/base/tmux/status index e96d10c..6643d46 100755 --- a/base/tmux/status +++ b/base/tmux/status @@ -6,6 +6,13 @@ if [[ "$1" = "toggle-task" ]]; then else tmux setenv TMUX_SHOW_TASK 1 fi + +elif [[ "$1" = "toggle-hint" ]]; then + if tmux showenv TMUX_SHOW_HINT &>/dev/null; then + tmux setenv -u TMUX_SHOW_HINT + else + tmux setenv TMUX_SHOW_HINT 1 + fi fi STATUS="#[bg=colour$HOST_COLOR]#[fg=black] $SHORT_HOSTNAME" @@ -22,12 +29,22 @@ if tmux showenv TMUX_SHOW_TASK &>/dev/null; then rc.report.x.sort=start-,urgency- x | head -n1 | xargs)" if [[ "$TASKCTX" ]]; then - TASKCOUNT="#[fg=colour19]#[bg=colour19,fg=colour7] $TASKCTX: $TASKCOUNT #[fg=colour18]#[bg=colour18]#[fg=colour20]" + TASKCOUNT="#[fg=colour19]#[bg=colour19,fg=colour7] $TASKCTX: $TASKCOUNT #[fg=colour18]#[fg=colour20,bg=colour18]" else TASKCOUNT="#[fg=colour8]#[fg=colour20] $TASKCOUNT #[fg=colour8]#[fg=colour20]" fi TASKLINE="$TASKCOUNT $TOPTASK. $(task $TASKCFG _get ${TOPTASK}.description) " + +elif tmux showenv TMUX_SHOW_HINT &>/dev/null; then + HINTF="$(dirname "$0")/hint" + HINTS="${HINTF}s" + if [[ "$(find "$HINTF" -mmin +2)" ]]; then + grep -v '^//' "$HINTS"* | shuf | head -n1 >"$HINTF" + fi + + TASKLINE="$(cat "$HINTF")" + else TASKLINE=""; fi STATUS="$TASKLINE#[fg=colour19]#[bg=colour19,fg=colour7] %a %m.%d %R" -- cgit v1.2.3-70-g09d2