summaryrefslogtreecommitdiff
path: root/.local/bin/tmux-py
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-02-10 07:24:43 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2024-02-10 07:24:43 -0500
commit88b4a4fd4466d2270ec35083bb3959ca17c6d014 (patch)
treea8d628329212ede0fb97129c5c501c0232082945 /.local/bin/tmux-py
parentb112ccd25f47bdccccbe74aa87cbe42532172c80 (diff)
Use python for dropdown calc instead of R
Diffstat (limited to '.local/bin/tmux-py')
-rwxr-xr-x.local/bin/tmux-py17
1 files changed, 17 insertions, 0 deletions
diff --git a/.local/bin/tmux-py b/.local/bin/tmux-py
new file mode 100755
index 0000000..6076f80
--- /dev/null
+++ b/.local/bin/tmux-py
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+session="Python"
+
+# 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" python -q
+ # R -q --no-save
+ # ([ -e /usr/bin/R ] && R -q --no-save) || python -q
+fi
+
+# Attach to created session
+tmux attach-session -t $session