Synergyクイック設定法

Synergyを使おうと思ったのだけれど、設定方法を忘れてしまい、かなり手間がかかってしまった。
過去にも同じことが何度かあったので、設定法をまとめておく。

環境

  • Arch Linux(x86_64, 3.14.2-1-ARCH)
  • synergy (1.4.17-1)
  • avahi (0.6.31-11)
  • nss-mdns (0.10-5)

必要なもの

設定手順

設定は、次の手順でおこなう。
また、特に明記しない限り、作業は、ホスト・クライアントの両方でおこなう。

  1. avahiデーモンの起動
  2. nsswitch.conf の書換え
  3. synergy.conf の書換え (ホスト側)
  4. synergyサーバの起動 (ホスト側)
  5. synergyクライアントの起動 (クライアント側)

設定

avahiデーモンの起動

avahiデーモンを起動する。


# systemctl enable avahi-daemon.service
# !:s/enable/start

nsswitch.conf の書換え

まず、/etc/nsswitch.conf のバックアップを作成する。


# cp /etc/nsswitch.conf /etc/nsswitch.conf.bak
次に、/etc/nsswitch.conf を以下のように書換える。

$ diff nsswitch.conf nsswitch.conf.bak
9c9< hosts: files myhostname mdns_minimal [NOTFOUND=return] dns

    • -

> hosts: files dns myhostname

synergy.conf の書換え

ホスト側で設定をおこなう。

まず、/etc/synergy.conf.example をコピーし、/etc/synergy.conf を作成する。

# cp /etc/synergy.conf.example /etc/synergy.conf

次に、/etc/synergy.conf を以下のように書換える。


$ diff /etc/synergy.conf /etc/synergy.conf.example
7,8c7,10< host:< client:

    • -

> # three hosts named: moe, larry, and curly
> moe:
> larry:
> curly:
12,13c14,17< host:< down = client

    • -

> # larry is to the right of moe and curly is above moe
> moe:
> right = larry
> up = curly
15,16c19,30< client:< up = host

    • -

> # moe is to the left of larry and curly is above larry.
> # note that curly is above both moe and larry and moe
> # and larry have a symmetric connection (they're in
> # opposite directions of each other).
> larry:
> left = moe
> up = curly
>
> # larry is below curly. if you move up from moe and then
> # down, you'll end up on larry.
> curly:
> down = larry
19,22c33,37< #section: aliases< # client:< # snowleopard< #end

    • -

> section: aliases
> # curly is also known as shemp
> curly:
> shemp
> end

synergyサーバの起動

ホスト側で synergys を実行する。


$ synergys -f

synergyクライアントの起動

クライアント側で synergyc を実行する。


$ synergyc -f host.local

復旧方法

まず、/etc/nsswitch.conf をバックアップファイルから復旧する。

# mv /etc/nsswitch.conf /etc/nsswitch.conf.old && mv /etc/nsswitch.conf.bak /etc/nsswitch.conf
次に、avahiデーモンを停止する。

# systemctl disable avahi-daemon.service
# !:s/disable/stop
最後に、ホスト側で作成した /etc/synergy.conf を削除する。
# rm /etc/synergy.conf

雑記

  • 細かい設定は後で考える