diff --git a/.gitignore b/.gitignore index acef7ab..960f10d 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ home/user/.termux/shell home/user/.config/tmux/plugins home/user/.config/tmux/local.conf -!home/user/.tmux/* -!home/user/.tmux/dotfiles.sh -!home/user/.tmux/temp.sh \ No newline at end of file +home/user/.tmux/* +!home/user/.tmux/dotfiles +!home/user/.tmux/temp +!home/user/.tmux/ssh \ No newline at end of file diff --git a/home/user/.tmux/dotfiles b/home/user/.tmux/dotfiles new file mode 100755 index 0000000..402bec7 --- /dev/null +++ b/home/user/.tmux/dotfiles @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -x + +readonly SESSION=dotfiles +readonly MAINW=1 + +readonly WORKING_PROJECT="${HOME}/dotfiles" + +if ! tmux has-session -t "${SESSION}"; then + tmux new-session -s "${SESSION}" -d -n "${MAINW}" -c "${WORKING_PROJECT}" + tmux splitw -t "${SESSION}:${MAINW}" -d -b -h -l "${_tmux_other_pane_size}" -c '#{pane_current_path}' + tmux send-keys -t "${SESSION}:${MAINW}.1" "git pull && git push" Enter + tmux send-keys -t "${SESSION}:${MAINW}.2" '$EDITOR' Enter + tmux send-keys -t "${SESSION}:${MAINW}.2" ':Telescope find_files' Enter +fi + +tmux switch-client -t "${SESSION}" \ No newline at end of file diff --git a/home/user/.tmux/dotfiles.sh b/home/user/.tmux/dotfiles.sh deleted file mode 100755 index b4c077f..0000000 --- a/home/user/.tmux/dotfiles.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -set -x - -SESSION=dotfiles -MAINW=1 - -WORKING_PROJECT="$HOME/dotfiles" - -if ! tmux has-session -t "$SESSION"; then - tmux new-session -s "$SESSION" -d -n "$MAINW" -c "$WORKING_PROJECT" - tmux splitw -t "$SESSION:$MAINW" -d -b -h -l "$_tmux_other_pane_size" -c '#{pane_current_path}' - tmux send-keys -t "$SESSION:$MAINW.1" "git pull && git push" Enter - tmux send-keys -t "$SESSION:$MAINW.2" '$EDITOR' Enter - tmux send-keys -t "$SESSION:$MAINW.2" ':Telescope find_files' Enter -fi - -tmux switch-client -t "$SESSION" \ No newline at end of file diff --git a/home/user/.tmux/ssh b/home/user/.tmux/ssh new file mode 100755 index 0000000..2aa3227 --- /dev/null +++ b/home/user/.tmux/ssh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +echo -n "ssh server: " +declare SSH_SERVER +read -r SSH_SERVER +readonly SSH_SERVER + +readonly SESSION="ssh-${SSH_SERVER}" + +if ! tmux has-session -t "${SESSION}"; then + tmux new-session -s "${SESSION}" -d -n "${MAINW}" -c "${WORKING_PROJECT}" "ssh ${SSH_SERVER}" +fi + +tmux switch-client -t "${SESSION}" \ No newline at end of file diff --git a/home/user/.tmux/temp.sh b/home/user/.tmux/temp similarity index 100% rename from home/user/.tmux/temp.sh rename to home/user/.tmux/temp