diff options
Diffstat (limited to '.local/bin/tmux-r')
-rwxr-xr-x | .local/bin/tmux-r | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/.local/bin/tmux-r b/.local/bin/tmux-r new file mode 100755 index 0000000..14dd08a --- /dev/null +++ b/.local/bin/tmux-r @@ -0,0 +1,18 @@ +#!/bin/sh +# This script ensures that i3 will spawn a youtube tui. +session="R" + +# 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" R -q --no-save + # R -q --no-save + # ([ -e /usr/bin/R ] && R -q --no-save) || python -q +fi + +# Attach to created session +tmux attach-session -t $session + |