11

I believe the app switcher (command + tab) is tied to where the dock "is". The dock is available on both displays, but I believe the last display in which you clicked on the dock is where it actually is.

So when the dock is on my secondary display, the app switcher shows on that display. Which throws me off and I would rather have the app switcher stay on my main display.

How can this be done?

4

App Switcher is controlled by Dock. Whichever display the dock bar is on, so is App Switcher. This applescript is how I reset Dock bar to main display:

tell application "System Events"
    set screen edge of dock preferences to right
    set screen edge of dock preferences to bottom
end tell

If you run Dock unhidden/visible, most likely the Dock will make a flash appearance on the rightmost edge. To get rid of the flash:

tell application "System Events"

    set autohide of dock preferences to true
    delay 0.2
    set screen edge of dock preferences to right
    set screen edge of dock preferences to bottom
    set autohide of dock preferences to false

end tell

You can bind the script to a keyboard shortcut so it can be invoked quickly when necessary.

If you always have Dock hidden, you can put the script in a loop with a preferred amount of delay, and run it as a daemon. This way the daemon will periodically make sure the dock is in main display.

  • This is the correct answer. – ezrock Oct 8 '15 at 18:05
1

Desired Effects Sought

  1. Hide Dock at Will
  2. Keep Dock on Main Screen

Hide Dock at Will

Set hotkey to hide dock

in OS X: System Preferences > Keyboard > Shortcuts > Launchpad & Dock

  • check "Dock Hiding On/Off”

  • Set hotkey for “Dock Hiding On/Off” to Control D (or whatever you want).

  • Set timing for Dock Hiding timing to long duration (as shown in the following commands). I set mine to 99 (I think) so I will not accidently trigger the Dock.

Set timing for Dock Hiding timing to long duration (as shown in the following commands). I set mine to 99 (I think) so I will not accidently trigger the Dock.

Enter this into Terminal to make the Dock show without a delay:

defaults write com.apple.dock autohide-delay -float 0; killall Dock

Maybe you want to have a long delay (5 seconds) so that you never accidentally trigger the Dock:

defaults write com.apple.dock autohide-delay -float 5; killall Dock

To restore defaults:

defaults delete com.apple.dock autohide-delay; killall Dock

Keep Dock on Main Screen

You would think this is easy, but what really screws things up is when you move an application to full screen. It wreaks havoc with the dock positioning as well as revealing. To fix the problem, I am now trying Lawrence Post for the Apple Scripts. I implement them using Keyboard Maestro (highly recommend that app for automating these things). Should the full screen situation create a dock positioning problem, I simply set a hotkey to execute the Apple Script and reposition the dock.

Still to do

Automate using Keyboard Maestro to sense the dock has been moved to other monitors and automatically put the dock back to the main screen without using a hotkey.

0

I keep my dock on the right side of the screen which keeps it on one display, i.e. the rightmost display when I set up the arrangement.

0

The solution that worked for me was to move the dock from the side to the bottom.

My set-up:

enter image description here

From System Preferences > Dock:

enter image description here

Go to your main screen and take the cursor down to reveal the dock. Now try cmd+tab. The tab-switcher should appear in your main screen.

I found that I hardly care if the dock is at the bottom since I have it hidden and use Spotlight almost always. For others the compromise may seem larger.

-1

As sudo-workaround. I recommend hiding the dock. It feels a little more natural to me. At least until they allow the option to keep in on one display.

You must log in to answer this question.

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