2

I have multiple spaces setup and can navigate them via ctrl and the arrow keys left and right on the current active monitor.

Now I want to change to a space that sits on the other monitor.

How do I switch there? I am looking for a keyboard only solution.

3
  • My solution for this was to disable "Displays have separate Spaces" under Mission Control in System . Not an ideal solution, by a long shot, but it is better than reaching for the mouse. Commented Mar 21, 2016 at 17:41
  • @JedDaniels Why did you post it as a comment and not as an answer?
    – k0pernikus
    Commented Mar 21, 2016 at 17:53
  • I don't think it is an answer, just a barely functional workaround. I suppose I can put it as an answer if you'd like. I'm still looking for the right AppleScript to do this (which you can then trigger as a keyboard shortcut from the tool of your choice; I use QuickSilver), but I haven't found it yet (I'm no AppleScript junkie). Commented Mar 21, 2016 at 18:33

1 Answer 1

1

Here's a shell one-liner that will do what you ask:

cliclick -r m:=-50,300 w:50 kd:ctrl kp:arrow-left ku:ctrl w:50
  • cliclick is a tool to move the mouse and is unfortunately necessary for this
  • -r: When done, move the mouse back to where it was when it started
  • m:=-50,300: move the mouse to the coordinates (-50, 300). The = is to actually do negative x values (for another monitor) rather than relative
  • w:50: wait 50 milliseconds
  • kd:ctrl: Press control key
  • kp:arrow-left: Press and release the left arrow
  • ku:ctrl: Release control key
  • w:50: wait 50 milliseconds

(0,0) is the upper left corner of the primary monitor.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .