aboutsummaryrefslogtreecommitdiff
path: root/tmuxrdr/plugin/bin/display-message
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-10-05 11:27:00 +0300
committerIgor Soarez <igor@soarez.org>2026-10-05 11:27:00 +0300
commit986e760687a2d34051934d410bec71fa2efc349b (patch)
treef57dcc4ba0d7690fdf90eeb2f0970a8ebbefc45a /tmuxrdr/plugin/bin/display-message
parent7b116c05bfda646af39d2524c54e70c751f57ee8 (diff)
tmuxrdr: tmux-mode plugin
The tmux default prefix bindings herdr has no built-in action for, as a herdr plugin built on its CLI and socket: break-pane, swap-pane and rotate-window by pane order (focus behaviour measured on tmux 3.7c), mark/clear-mark, last-window and switch-client -l (from focus events, per session), select-window and move-window by index, paste-buffer -p, display-message in tmux's default format, select-layout -E, kill-pane and kill-window behind tmux's y/n prompts, a command prompt taking tmux's commands, clock-mode, show-messages, and automatic-rename. Also a .gitignore for secrets scoped to tmuxrdr/, leaving herdr's own untouched.
Diffstat (limited to 'tmuxrdr/plugin/bin/display-message')
-rwxr-xr-xtmuxrdr/plugin/bin/display-message15
1 files changed, 15 insertions, 0 deletions
diff --git a/tmuxrdr/plugin/bin/display-message b/tmuxrdr/plugin/bin/display-message
new file mode 100755
index 00000000..e2ff0192
--- /dev/null
+++ b/tmuxrdr/plugin/bin/display-message
@@ -0,0 +1,15 @@
+#!/bin/sh
+# tmux prefix+i (display-message), in tmux's default template -- measured on
+# tmux 3.7c: "[0] 0:zsh, current pane 0 - (10:30 05-Oct-26)", i.e.
+# [#S] #I:#W, current pane #P - (%H:%M %d-%b-%y). Session is the workspace,
+# window index its place in the tab bar, window name the tab label.
+. "$(dirname "$0")/../lib.sh"
+
+p="$(active_pane)"
+ws="$(pane_info "$p" workspace_id)"
+tab="$(pane_info "$p" tab_id)"
+session="$("$H" workspace get "$ws" | jq -r '.result.workspace.label // empty')"
+line="$(workspace_tabs "$ws" | grep -n -F "$tab " | head -n 1)"
+window_index="${line%%:*}"
+window_name="$(printf '%s' "${line#*:}" | cut -f2)"
+say "[$session] $window_index:$window_name, current pane $(pane_index "$p") - ($(date '+%H:%M %d-%b-%y'))"