From 352f3fe1a1044c4bffce0b47cde93556767b0767 Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Mon, 12 Nov 2018 21:15:19 +0300 Subject: [PATCH] switch aurman to yay --- zsh/pacman_common.zsh | 4 ++-- zsh/pacman_test.zsh | 8 ++++---- zsh/tmux.zsh | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 zsh/tmux.zsh diff --git a/zsh/pacman_common.zsh b/zsh/pacman_common.zsh index d02ebf9..1c9c03f 100644 --- a/zsh/pacman_common.zsh +++ b/zsh/pacman_common.zsh @@ -2,6 +2,6 @@ pacman() { /usr/bin/sudo /usr/bin/pacman $* && echo "$*" | grep -q "S\|R\|U" && rehash } -aurman() { - /usr/bin/aurman $* && echo "$*" | grep -q "S\|R\|U" && rehash +yay() { + /usr/bin/yay $* && echo "$*" | grep -q "S\|R\|U" && rehash } diff --git a/zsh/pacman_test.zsh b/zsh/pacman_test.zsh index 6404c37..6941964 100644 --- a/zsh/pacman_test.zsh +++ b/zsh/pacman_test.zsh @@ -1,7 +1,7 @@ # pacman commands with repo variations -aurtest() { - /usr/bin/aurman --config /etc/pactest.conf $* && echo "$*" | grep -q "S\|R\|U" && rehash +yaytest() { + /usr/bin/yay --config /etc/pactest.conf $* && echo "$*" | grep -q "S\|R\|U" && rehash } -auraur() { - /usr/bin/aurman --config /etc/pacaur.conf $* && echo "$*" | grep -q "S\|R\|U" && rehash +yayaur() { + /usr/bin/yay --config /etc/pacaur.conf $* && echo "$*" | grep -q "S\|R\|U" && rehash } diff --git a/zsh/tmux.zsh b/zsh/tmux.zsh new file mode 100644 index 0000000..103b8b0 --- /dev/null +++ b/zsh/tmux.zsh @@ -0,0 +1,34 @@ +# +# Defines tmux aliases and provides for auto launching it at start-up. +# +# Authors: +# Sorin Ionescu +# Colin Hebert +# + +# Aliases +alias ta="tmux attach-session" +alias tl="tmux list-sessions" + +# Auto Start +if [[ -z "$TMUX" ]]; then + tmux_session='#OMZ' + + if ! tmux has-session -t "$tmux_session" 2> /dev/null; then + # Disable the destruction of unattached sessions globally. + tmux set-option -g destroy-unattached off &> /dev/null + + # Create a new session. + tmux new-session -d -s "$tmux_session" + + # Disable the destruction of the new, unattached session. + tmux set-option -t "$tmux_session" destroy-unattached off &> /dev/null + + # Enable the destruction of unattached sessions globally to prevent + # an abundance of open, detached sessions. + tmux set-option -g destroy-unattached on &> /dev/null + fi + + exec tmux new-session -t "$tmux_session" +fi +