blob: e2ff019246c80ab209513bf15a2467ffe9493c82 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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'))"
|