summaryrefslogtreecommitdiff
path: root/.local/bin/tmux-r
blob: 14dd08ae8164825669521a763d9d8eee3bbd70cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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