summaryrefslogtreecommitdiff
path: root/.local/bin/tmux-shell
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2020-10-03 19:27:15 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2020-10-03 19:27:15 -0400
commite371d9edd474bcf89cf5d462eaccb8638900b390 (patch)
treeed07118f5c514a55f23a779a1507640e46fd9ed2 /.local/bin/tmux-shell
Initial commit
Diffstat (limited to '.local/bin/tmux-shell')
-rwxr-xr-x.local/bin/tmux-shell18
1 files changed, 18 insertions, 0 deletions
diff --git a/.local/bin/tmux-shell b/.local/bin/tmux-shell
new file mode 100755
index 0000000..9c95cf7
--- /dev/null
+++ b/.local/bin/tmux-shell
@@ -0,0 +1,18 @@
+#!/bin/sh
+# This script ensures that i3 will spawn a youtube tui.
+session="Shell"
+
+# Check if the session exists, discarding output
+# We can check $? for the exit status (zero for success, non-zero for failure)
+tmux has-session -t $session 2>/dev/null
+
+if [ $? != 0 ]; then
+ # Set up your session
+ tmux new-session -d -s "$session" zsh
+ # R -q --no-save
+ # ([ -e /usr/bin/R ] && R -q --no-save) || python -q
+fi
+
+# Attach to created session
+tmux attach-session -t $session
+