Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Screen rotation with Automator and a script

I have no knowledge whatsoever about scripts, coding nor automator. I keep reading threads regarding the issue but I don't understand them. It would be of great help to me if someone please explained how to create some sort of keyboard shortcut that changed screen rotation (the macbook's own screen, not an external one) using automator and a script on a Macbook Air running OS X El Capitan 10.11.2.


Is it possible?


Thank you in advance.

MacBook Air (13-inch, Early 2015), OS X El Capitan (10.11.2), null

Posted on Jun 11, 2016 4:10 AM

Reply
Question marked as Best reply

Posted on Jun 11, 2016 11:39 AM

One option is to use the command line utility fb-rotate in an Automator service and assign a keyboard shortcut to it. Download the fb-rotate source file from GitHub, compile following the directions on GitHub, and output the binary to /usr/local/bin; or download a compiled binary and relocate it to usr/local/bin.


Create an Automator service, set options as "Service receives no input in any application", add a Run Shell Script action, and set the options as "Shell: /bin/bash", "Pass input: to stdin". Type in the fb-rotate command for the desired degree of screen orientation such as "/usr/local/bin/fb-rotate -d 0 -r 180" for 180° on the main display. Save the service with a name.

User uploaded file

Navigate to  > System Preferences > Keyboard > Shortcuts > Services. Scroll to the service you created, select it, click "none" and create a keyboard shortcut using a unique key combination. Create separate Automator services for additional screen orientations. Quit System Preferences when finished.

User uploaded file

Tested with OS X Yosemite 10.10.5 and El Capitan 10.11.3

2 replies
Question marked as Best reply

Jun 11, 2016 11:39 AM in response to Edenthor

One option is to use the command line utility fb-rotate in an Automator service and assign a keyboard shortcut to it. Download the fb-rotate source file from GitHub, compile following the directions on GitHub, and output the binary to /usr/local/bin; or download a compiled binary and relocate it to usr/local/bin.


Create an Automator service, set options as "Service receives no input in any application", add a Run Shell Script action, and set the options as "Shell: /bin/bash", "Pass input: to stdin". Type in the fb-rotate command for the desired degree of screen orientation such as "/usr/local/bin/fb-rotate -d 0 -r 180" for 180° on the main display. Save the service with a name.

User uploaded file

Navigate to  > System Preferences > Keyboard > Shortcuts > Services. Scroll to the service you created, select it, click "none" and create a keyboard shortcut using a unique key combination. Create separate Automator services for additional screen orientations. Quit System Preferences when finished.

User uploaded file

Tested with OS X Yosemite 10.10.5 and El Capitan 10.11.3

Screen rotation with Automator and a script

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.