diff options
author | Ryan Kavanagh <rak@rak.ac> | 2025-08-21 13:21:45 -0400 |
---|---|---|
committer | Ryan Kavanagh <rak@rak.ac> | 2025-08-21 13:21:45 -0400 |
commit | f19f5df73ac0fdc3efa14649c4b646bcc4de84f4 (patch) | |
tree | c323a796deb32800dd3dc054fe778f1787d3f953 /dot_local/bin/executable_tmcg | |
parent | Adopt straight.el (diff) |
Move ~/bin to ~/.local/bin
Diffstat (limited to 'dot_local/bin/executable_tmcg')
-rwxr-xr-x | dot_local/bin/executable_tmcg | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/dot_local/bin/executable_tmcg b/dot_local/bin/executable_tmcg new file mode 100755 index 0000000..5ebb3cf --- /dev/null +++ b/dot_local/bin/executable_tmcg @@ -0,0 +1,29 @@ +#!/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) +NEW=1 + +if [ "x${SESSION}" = "x" ]; then + SESSION="irc" + tmux new-session -s "${SESSION}" -d + NEW=$? +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 + if test ${NEW} -eq 0; then + tmux kill-window -t ${SESSION}:0 + fi +fi |