I’m a Systems/Software Engineer in the San Francisco Bay Area. I moved from Columbus, Ohio in 2007 after getting a B.S. in Physics from the Ohio State University. I'm married, and we have dogs.

Under my github account (https://github.com/addumb): I open-sourced python-aliyun in 2014, I have an outdated python 2 project starter template at python-example, and I have a pretty handy “sshec2” command and some others in tools.

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

January 12, 2011

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!

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License. :wq