tmux: refactor install script + aliases.zsh
This commit is contained in:
parent
e6bdea030f
commit
a88a10e47d
|
@ -1,7 +1,7 @@
|
|||
alias ta='tmux attach'
|
||||
alias tl='tmux ls'
|
||||
|
||||
if [ -n "$TMUX" ]; then
|
||||
if [[ $TMUX ]]; then # From inside tmux
|
||||
alias t='tmux'
|
||||
alias tf='tmux find-window'
|
||||
# Detach all other clients to this session
|
||||
|
@ -15,11 +15,13 @@ if [ -n "$TMUX" ]; then
|
|||
tmux switch-client -t "$name"
|
||||
tmux display-message "Session #S created"
|
||||
}
|
||||
else
|
||||
else # From outside tmux
|
||||
t() {
|
||||
if (( $# > 0 )); then
|
||||
tmux $@ || tmux attach -t main
|
||||
else tmux new -s main; fi
|
||||
else
|
||||
tmux new -s main
|
||||
fi
|
||||
}
|
||||
|
||||
# Start grouped session so I can be in two different windows in one session
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
case "$OSTYPE" in
|
||||
case $OSTYPE in
|
||||
darwin*)
|
||||
brew install tmux
|
||||
;;
|
||||
linux*)
|
||||
if [ -f /etc/arch-release ]; then
|
||||
sudo pacman --noconfirm -S tmux
|
||||
sudo pacman --needed --noconfirm -S tmux
|
||||
elif [ -f /etc/debian-version ]; then
|
||||
sudo apt-get install -y tmux
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
git-repo() { [[ -d $2 ]] || git clone "https://github.com/$1" "$2"; }
|
||||
|
|
Loading…
Reference in a new issue