Linux Tip: awesome and synergy for less mouse/keyboard switching

January 12, 2011 by

I use a desktop plus a laptop at work. My desktop is running Ubuntu, and my laptop is running OS X (MacBook Pro). I started to use synergy right off the bat. Eventually I got tired of having to move my mouse across the screens to change the focus, so I added this to my ~/.synergy.conf:

section: options
  keystroke(alt+super+l) = switchInDirection(right)
  keystroke(alt+super+h) = switchInDirection(left)
end

And I was happy for a while! I started to use terminator because I always had 4+ gnome-terminal sessions open at once and wanted to see them all (tabs only took me so far). Sad thing is, I could never get the terminator navigation keys to work predictably. If I had 4 terminals open at once, alt+direction never behaved how I expected.

So I gave a tiling window manager a try: awesome. It's... well it's awesome. It gets REALLY weird if you have a bunch of modal windows though, so be careful running Ubuntu's update manager or such.

But there was a problem! I have two monitors on my desktop, which awesome understands as two screens. Perfect! That's what I hoped for. Switching back and forth between the screens with mod4+control+j or k moves the mouse cursor to 0,0 (top left corner) of each screen. Synergy interprets that as its cue to switch screens, so when I move to 0,0 on my left monitor, synergy moves the focus over to my laptop (to the left of both monitors). Crap. Then I have to hit mod4+alt+l (that's L) to get to my desktop again, so I could never easily move from my right monitor back to my left monitor because it would always trip over to my laptop (leftmost screen).

The was super simple, though. Found it in a mailing list, of course. Add this to ~/.synergy.conf:

section: options
  switchCorners = top-left
  switchCornerSize = 2
end
That makes synergy not switch screens when the mouse is over a two-pixel cross in the top-left corner. Now I can switch screens within awesome and within synergy! So much less mouse needed!

Update: How do you set up awesome and synergy? Oh, glad you asked! I'm running Ubuntu 10.something-ish, so I did this to set up awesome:

$ sudo apt-get install awesome
$ gnome-session-properties
Then:

  1. Uncheck your window manager (metacity or compiz?)
  2. Click Add
  3. Enter "awesome" or really anything you like for the Name
  4. Enter "awesome" for the Command
  5. Optionally fill in a comment
  6. Click Add
  7. Log out and back in!

Made by Adam for himself at addumb.com
:wq