dotfiles
shell, editor, ssh.
git clone https://owenrusk.dev/dotfiles.git
commit 7102842eebbaf913e5ae1717a07f9eea136be6a0 parent be8acc710adb0de092c6ceb5439aae27c2f53b93 author Owen Rusk <owen@papermothgames.com> date 2024-03-28 14:10:44 -0500
bin: tm, a tmux session per project
| bin/tm | +9 | -0 |
| install.sh | +4 | -0 |
| zsh/aliases.zsh | +1 | -0 |
diff --git a/bin/tm b/bin/tm new file mode 100755 index 0000000..ade19fc --- /dev/null +++ b/bin/tm @@ -0,0 +1,9 @@ +#!/bin/sh +# a tmux session per project: named after the directory, made if it isn't there. +name=${1:-$(basename "$PWD" | tr . _)} + +if [ -n "${TMUX:-}" ]; then + tmux has-session -t "=$name" 2>/dev/null || tmux new-session -ds "$name" -c "$PWD" + exec tmux switch-client -t "=$name" +fi +exec tmux new-session -A -s "$name" -c "$PWD" diff --git a/install.sh b/install.sh index 9745351..188f951 100755 --- a/install.sh +++ b/install.sh @@ -14,3 +14,7 @@ link nvim "$HOME/.config/nvim" link tmux/tmux.conf "$HOME/.tmux.conf" link git/config "$HOME/.config/git/config" link git/ignore "$HOME/.config/git/ignore" + +for f in "$here"/bin/*; do + link "bin/${f##*/}" "$HOME/.local/bin/${f##*/}" +done diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index de35eee..9745783 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -8,5 +8,6 @@ alias df='df -h' alias du='du -h' alias v=nvim alias g=git +alias t=tm alias py=python3 alias src='cd ~/src'