From 2a73c55a40b48b6d8ff78fd9a566bea3c86d3480 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Wed, 5 Feb 2020 17:35:32 +0000 Subject: [PATCH] Make tm a function --- roles/home-cli/files/shrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/roles/home-cli/files/shrc b/roles/home-cli/files/shrc index 4ddf0f9..e68d75c 100644 --- a/roles/home-cli/files/shrc +++ b/roles/home-cli/files/shrc @@ -92,7 +92,6 @@ alias ls="/bin/ls $LSOPTIONS" alias now="date +%Y%m%dT%H%M%S%z" alias nowu="date -u +%Y%m%dT%H%M%SZ" alias ta="$HOME/opt/textadept/textadept" -alias tm="tmux -2 attach-session || tmux -2 new-session" alias wgr="wordgrinder" alias ytmp3="youtube-dl -q -x --audio-format=mp3" @@ -213,6 +212,14 @@ emacsro () { emacs $1 -f view-mode } +tm () { + if tmux list-session 2>/dev/null 1>/dev/null; then + tmux -2 attach-session + else + tmux -2 new-session + fi +} + if [ -x /usr/bin/yum ] && [ ! -x /usr/bin/dnf ]; then alias dnf='yum' fi