|
|
|
@ -1,25 +1,29 @@ |
|
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
############################################################################## |
|
|
|
|
# |
|
|
|
|
# tmux_sidebar.sh |
|
|
|
|
# By Steven Saus |
|
|
|
|
# (c) 2020; licensed under the MIT license |
|
|
|
|
# |
|
|
|
|
############################################################################## |
|
|
|
|
|
|
|
|
|
#maybe use this as a setup for those programs and have a permanent sidebar? |
|
|
|
|
#tmux send-keys -t "%74" "chafa " "/home/steven/downloads/images/big_keys_for_logo.jpg" "C-m" |
|
|
|
|
# See the space!!! |
|
|
|
|
#replaces man command - makes help a fallback |
|
|
|
|
# use pick to deal with the output better |
|
|
|
|
#TOD |
|
|
|
|
|
|
|
|
|
c_tmux=$(env | grep -c TMUX) |
|
|
|
|
if [ $c_tmux -gt 0 ];then |
|
|
|
|
command=$(echo "$@") |
|
|
|
|
o_pane=$(tmux ls -F "#D") |
|
|
|
|
tmux split-window -h |
|
|
|
|
#"$command" |
|
|
|
|
c_pane=$(tmux ls -F "#D") |
|
|
|
|
printf '\033]2;%s\033\\' 'sidebar' |
|
|
|
|
tmux resize-pane -t "$c_pane" -R 20 |
|
|
|
|
tmux select-pane -m -t "$c_pane" |
|
|
|
|
#echo "$c_pane" |
|
|
|
|
tmux send-keys -t "$c_pane" "$command && exit" C-m |
|
|
|
|
# Uncomment for left hand sidebar |
|
|
|
|
#tmux swap-pane -s "$o_pane" -t "$c_pane" |
|
|
|
|
printf '\033]2;%s\033\\' 'topbar' |
|
|
|
|
tmux resize-pane -t "$c_pane" -R 30 |
|
|
|
|
command2=$(echo "$command ; tmux kill-pane -t ${c_pane}") |
|
|
|
|
tmux send-keys -t "$c_pane" "$command2" C-m |
|
|
|
|
tmux last-pane |
|
|
|
|
#tmux send-keys -t "$o_pane" C-o C-m |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# if [ $c_tmux -gt 0 ];then |
|
|
|
|
# tmux kill-pane -t "$c_pane" |
|
|
|
|