aboutsummaryrefslogtreecommitdiff
path: root/base/tmux/status
diff options
context:
space:
mode:
authorAlexis Hovorka <[email protected]>2023-05-01 14:11:41 -0600
committerAlexis Hovorka <[email protected]>2023-05-01 14:11:41 -0600
commit7afa24fc137884edd77925d10ab928cd1cc3adc0 (patch)
tree202e73f9507ff11098849bf72ba0d8a8df01d7ba /base/tmux/status
parent6d21e6a94fbcc061966a5b3850477202e868a912 (diff)
[feat] Add reference bar to tmux
Diffstat (limited to 'base/tmux/status')
-rwxr-xr-xbase/tmux/status19
1 files changed, 18 insertions, 1 deletions
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"