Is there a script that could be written to achieve this:
In System Preferences/Displays… is it possible to relocate the menu bar …via a script?
My set-up is one monitor and a Cintiq. I either work only with the Cintiq, or I work with my 28" monitor several times a day. I always need to go to do this manually.
I really wish there was a script that can do this. I tried Automator, but it's not recording the action. 🙁
Script to relocate the menu-bar on dual monitors set-up
displaymenu barscript
Related Question
- MacOS – way to make the Menu bar show at all times in fullscreen windows
- AppleScript: Cannot click Menulet (Menu Bar 2) for Third Party App
- MacOS – Menu bar turns red on secondary screen
- When running a script from the scripts menu, where is console output captured
- How to you active the Script Menu Bar with AppleScript
- MacOS – AppleScript, set the position of the frontmost window, even if not AppleScriptable
Best Answer
You can use a command line utility named cscreen to do that. You can wrap it in a AppleSctipt script or in Automator. You can download the cscreenIntel.dmg from the link provided. In a terminal use
cscreen -h
to output the internal help information.I have a MBP and a Thunderbolt Display so in a Terminal I want to have
cscreen
list my displaysSo to set the Thunderbolt Display to have the menu bar I run the following command:
cscreen -s 2 -p
I can then toggle it back using the same command as the Index shifts.
In AppleScript:
do shell script "/<path_to>/cscreen -s 2 -p"
In Automator add Run Shell Script and add command:
/<path_to>/cscreen -s 2 -p
Note: This is a simple toggle if you only have two displays however if you have more then two you'll need to write some logic flow into the script.
You can also use,
cscreen -i <DisplayID> -p
, e.g.cscreen -i 3247b0f -p
to code with theDisplayID
which doesn't change.This can also just be used in a Terminal as a singular command or incorporated into a shell script without using AppleScript and or Automator.