add tmux systemd service

This commit is contained in:
thek4n 2024-04-03 13:59:43 +03:00
parent 3e1ad38e3e
commit 120f7fe29e
4 changed files with 14 additions and 5 deletions

View File

@ -1,8 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# .bashrc by TheK4n
# https://github.com/TheK4n/dotfiles # https://github.com/TheK4n/dotfiles
if command -v tmux &>/dev/null && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ] && [ "$(tty)" != "/dev/tty3" ]; then if \
[ "$(tty)" != "/dev/tty3" ] && \
[ -z "$TMUX" ] && \
[[ ! "$TERM" =~ tmux ]] && \
command -v tmux &>/dev/null
then
exec tmux exec tmux
fi fi

View File

@ -1,7 +1,12 @@
# .zshrc by TheK4n # .zshrc by TheK4n
# https://github.com/TheK4n/dotfiles # https://github.com/TheK4n/dotfiles
if command -v tmux &>/dev/null && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ] && [ "$(tty)" != "/dev/tty3" ]; then if \
[ "$(tty)" != "/dev/tty3" ] && \
[ -z "$TMUX" ] && \
[[ ! "$TERM" =~ tmux ]] && \
command -v tmux &>/dev/null
then
exec tmux exec tmux
fi fi

View File

@ -11,7 +11,7 @@ if ! tmux has-session -t "$SESSION"; then
tmux new-session -s "$SESSION" -d -n "$MAINW" -c "$WORKING_PROJECT" tmux new-session -s "$SESSION" -d -n "$MAINW" -c "$WORKING_PROJECT"
tmux send-keys -t "$SESSION:$MAINW" '$EDITOR' Enter tmux send-keys -t "$SESSION:$MAINW" '$EDITOR' Enter
tmux send-keys -t "$SESSION:$MAINW" , f f tmux send-keys -t "$SESSION:$MAINW" , f f
tmux splitw -t "$SESSION:$MAINW" -d -h -l 35% -c '#{pane_current_path}' tmux splitw -t "$SESSION:$MAINW" -d -h -l 40% -c '#{pane_current_path}'
fi fi
tmux switch-client -t "$SESSION" tmux switch-client -t "$SESSION"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
systemctl --user enable --now tmux command -v systemctl && systemctl --user enable --now tmux
git clone https://github.com/tmux-plugins/tpm "$HOME/.config/tmux/plugins/tpm" git clone https://github.com/tmux-plugins/tpm "$HOME/.config/tmux/plugins/tpm"