From 3ee16ddbbc874b54f97af04cc59d8e1b46ae38e1 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 1 Dec 2011 01:59:26 -0500 Subject: [PATCH] Rounded some stuff out, add rtorrent support. --- plugins/tmux/tmux.plugin.zsh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index eb13a7603..c15c6d797 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -9,13 +9,26 @@ if (( $+commands[tmux] )); then zstyle -a :omz:plugins:autostart state [[ state == "on" && -z $TMUX ]] && exec tmux + # start an irc client in a tmux session if [[ -n $IRC ]]; then irc() { if tmux has -t irc >/dev/null; then - tmux switch -t irc + [[ -n $TMUX ]] && tmux switch -t irc || tmux attach -t irc else TMUX="" tmux new -ds irc $IRC[1] - tmux switch -t irc + [[ -n $TMUX ]] && tmux switch -t irc || tmux attach -t irc + fi + } + fi + + # start rtorrent in a tmux session + if [[ -n $RTORRENT ]]; then + torrents() { + if tmux has -t torrents >/dev/null; then + [[ -n $TMUX ]] && tmux switch -t torrents || tmux attach -t torrents + else + TMUX="" tmux new -ds torrents $RTORRENT[1] + [[ -n $TMUX ]] && tmux switch -t torrents || tmux attach -t torrents fi } fi