summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2024-11-28 15:23:35 +0200
committerKyren223 <Kyren223@proton.me>2024-11-28 15:23:35 +0200
commitd709d2de54f5be174bebde60a10e0e3fc7b58b44 (patch)
tree91e703ee01c00a40c40ea6299887a893f09c3b4a /scripts
parent9773ec9330ea80c7ae42e647423e810b20043dba (diff)
Fixed tmux loading on startup issue, also loads $HOME automatically
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/tms9
-rwxr-xr-xscripts/tmux-session-setup5
2 files changed, 10 insertions, 4 deletions
diff --git a/scripts/tms b/scripts/tms
index 97407cb..1bab0d4 100755
--- a/scripts/tms
+++ b/scripts/tms
@@ -14,9 +14,8 @@ selected_name=$(basename "$selected" | tr . _)
tmux_running=$(pgrep tmux)
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then
- tmux new-session -s $selected_name -c $selected
+ tmux new-session -ds $selected_name -c $selected
tmux-session-setup $selected_name $selected
- exit 0
fi
if ! tmux has-session -t=$selected_name 2> /dev/null; then
@@ -24,4 +23,8 @@ if ! tmux has-session -t=$selected_name 2> /dev/null; then
tmux-session-setup $selected_name $selected
fi
-tmux switch-client -t $selected_name
+if [[ -z $TMUX ]]; then
+ tmux attach-session -t $selected_name
+else
+ tmux switch-client -t $selected_name
+fi
diff --git a/scripts/tmux-session-setup b/scripts/tmux-session-setup
index 835e2c5..be51ad6 100755
--- a/scripts/tmux-session-setup
+++ b/scripts/tmux-session-setup
@@ -3,7 +3,10 @@
sess=$1
dir=$2
-if [ "$sess" = "eko" ]; then
+if [ "$dir" = "$HOME" ]; then
+ tmux rename-window -t $sess:1 main
+ tmux send-keys -t $sess:main.1 "fastfetch" C-m
+elif [ "$sess" = "eko" ]; then
tmux rename-window -t $sess:1 editor
tmux send-keys -t $sess:editor.1 "vim" C-m