diff options
author | Ryan Kavanagh <rak@rak.ac> | 2021-12-13 17:23:42 -0500 |
---|---|---|
committer | Ryan Kavanagh <rak@rak.ac> | 2021-12-13 17:23:42 -0500 |
commit | e1096db47d332f2e4bfb4f38d262bb94e69d9ad5 (patch) | |
tree | 1b26b1fedacd307a115cb3a963c8cc8a60a18e96 /bin/executable_tmcg | |
parent | typo (diff) |
set exec and stuff
Diffstat (limited to 'bin/executable_tmcg')
-rwxr-xr-x | bin/executable_tmcg | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bin/executable_tmcg b/bin/executable_tmcg new file mode 100755 index 0000000..d94abbc --- /dev/null +++ b/bin/executable_tmcg @@ -0,0 +1,24 @@ +#!/bin/sh + +current_session () { + tty=$(tty) + for s in $(tmux list-sessions -F '#{session_name}'); do + tmux list-panes -F '#{pane_tty} #{session_name}' -t "$s" + done | grep "${tty}" | awk '{print $2}' +} + +SESSION=$(current_session) + +if [ "x${SESSION}" = "x" ]; then + SESSION="irc" + tmux new-session -s "${SESSION}" -d +fi + +if ! tmux switch -t ${SESSION}:catgirl >/dev/null 2>&1; then + tmux new-window -c '~' -n catgirl catgirl libera + tmux split-window -t ${SESSION}:catgirl -c '~' catgirl oftc + tmux split-window -t ${SESSION}:catgirl -c '~' catgirl sdf + tmux split-window -t ${SESSION}:catgirl -c '~' catgirl tilde + tmux set-option -t ${SESSION}:catgirl remain-on-exit on + tmux selectl -t ${SESSION}:catgirl tiled +fi |