Synergyクイック設定法
Synergyを使おうと思ったのだけれど、設定方法を忘れてしまい、かなり手間がかかってしまった。
過去にも同じことが何度かあったので、設定法をまとめておく。
必要なもの
- synergy
- avahi
- nss-mdns
設定手順
設定は、次の手順でおこなう。
また、特に明記しない限り、作業は、ホスト・クライアントの両方でおこなう。
設定
nsswitch.conf の書換え
まず、/etc/nsswitch.conf のバックアップを作成する。
次に、/etc/nsswitch.conf を以下のように書換える。
# cp /etc/nsswitch.conf /etc/nsswitch.conf.bak
$ 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
復旧方法
まず、/etc/nsswitch.conf をバックアップファイルから復旧する。
# mv /etc/nsswitch.conf /etc/nsswitch.conf.old && mv /etc/nsswitch.conf.bak /etc/nsswitch.conf次に、avahiデーモンを停止する。
最後に、ホスト側で作成した /etc/synergy.conf を削除する。
# systemctl disable avahi-daemon.service
# !:s/disable/stop
# rm /etc/synergy.conf
雑記
- 細かい設定は後で考える
参考サイト
- Synergy - ArchWiki
https://wiki.archlinux.org/index.php/synergy - Avahi - ArchWiki
https://wiki.archlinux.org/index.php/Avahi