terminal: Create module to consolidate term utils
Terminal application, a variety of shell configurations, terminal file and session management all consolidated in one place.
This commit is contained in:
parent
2e0c992a54
commit
9781b26b22
31 changed files with 0 additions and 0 deletions
20
terminal/.local/bin/tmux_pane_tree
Executable file
20
terminal/.local/bin/tmux_pane_tree
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
# create a tree-style view
|
||||
# of all open tmux panes
|
||||
# and the command they are currently running
|
||||
|
||||
tmux ls -F'#{session_id}' | while read -r s; do
|
||||
S=$(tmux ls -F'#{session_id}#{session_name}: #{T:tree_mode_format}' | grep ^"$s")
|
||||
session_info=${S##$s}
|
||||
session_name=$(echo "$session_info" | cut -d ':' -f 1)
|
||||
if [[ -n "$1" ]] && [[ "$1" == "$session_name" ]]; then
|
||||
echo -e "\033[1;34m$session_info\033[0m"
|
||||
tmux lsw -t"$s" -F'#{window_id}' | while read -r w; do
|
||||
W=$(tmux lsw -t"$s" -F'#{window_id}#{T:tree_mode_format} - #{pane_current_command}' | grep ^"$w")
|
||||
H=$(tmux lsw -t"$s" -F'#{window_id}#H' | grep ^"$w")
|
||||
echo " ${W##$w}" | sed "s/\"${H##$w}\" //"
|
||||
done
|
||||
else
|
||||
echo -e "\033[1m$session_info\033[0m"
|
||||
fi
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue