From 388c21be63757d14bbb34f4de5205b8bc3e3a722 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 21 Aug 2014 17:13:14 -0700 Subject: [PATCH] tweak synergy. --- dotfiles/lib/shellrc/synergy.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dotfiles/lib/shellrc/synergy.sh b/dotfiles/lib/shellrc/synergy.sh index 9e80d442..77b8e13e 100644 --- a/dotfiles/lib/shellrc/synergy.sh +++ b/dotfiles/lib/shellrc/synergy.sh @@ -8,7 +8,7 @@ function make_me_synergy() { ;; esac done - test -z $(get_synergy_pids_for_ip) && synergyc $new_host_name + test -z $(get_synergy_pids_for_ip $new_host_name) && synergyc $new_host_name } function stop_synergy_at() { @@ -25,6 +25,7 @@ function clear_my_synergy() { } function get_synergy_pids_for_ip() { + echo $1 ps aux | grep synergyc | grep $1 | get_cols 2 } @@ -33,5 +34,6 @@ function clear_synergy_for_ip() { } function activate_synergy_for() { - synergys --config ~/synergy.conf && ssh $1 "source ~/.zshrc && make_me_synergy" + test -z $(pgrep synergys) && synergys --config ~/synergy.conf + ssh $1 "source ~/.zshrc && make_me_synergy" }