summaryrefslogtreecommitdiffstats
path: root/bashrc
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2011-03-13 02:50:13 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2011-03-13 02:50:13 +0100
commite29d9f63c9487e6849af911c479661c494066326 (patch)
treef9f747ebd5102590fefda07947910c23a31e4517 /bashrc
parent0887607b7a5d957ff2e3cd91b9cb960e78a63881 (diff)
downloaddotfiles-e29d9f63c9487e6849af911c479661c494066326.tar.gz
dotfiles-e29d9f63c9487e6849af911c479661c494066326.tar.xz
dotfiles-e29d9f63c9487e6849af911c479661c494066326.zip
tmux: added autoresume by simply using tmux or t
Diffstat (limited to 'bashrc')
-rwxr-xr-xbashrc/bin/t12
-rw-r--r--bashrc/common/alias.sh3
2 files changed, 15 insertions, 0 deletions
diff --git a/bashrc/bin/t b/bashrc/bin/t
new file mode 100755
index 0000000..30c624e
--- /dev/null
+++ b/bashrc/bin/t
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+if [[ "x$1" == x ]] ; then
+ \tmux list-sessions &>/dev/null ||
+ {
+ \tmux new-session -d
+ }
+
+ exec \tmux attach-session -d
+fi
+
+exec \tmux $@
diff --git a/bashrc/common/alias.sh b/bashrc/common/alias.sh
index c1e9b6b..88220d5 100644
--- a/bashrc/common/alias.sh
+++ b/bashrc/common/alias.sh
@@ -50,3 +50,6 @@ unzip() {
# screen autoresume
alias screen="screen -xR"
+
+# tmux autoresume
+hash tmux 2>/dev/null && alias tmux=t