#!/bin/sh # This script ensures that i3 will spawn a youtube tui. session="Podcast" url=$1 # 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" vlc -I ncurses "$url" # R -q --no-save # ([ -e /usr/bin/R ] && R -q --no-save) || python -q fi # Attach to created session tmux attach-session -t $session