Edenthor

Q: 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:11 AM

Close

Q: Screen rotation with Automator and a script

  • All replies
  • Helpful answers

  • by Roote,Solvedanswer

    Roote Roote Jun 11, 2016 11:39 AM in response to Edenthor
    Level 2 (417 points)
    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.

    Screen Shot 2016-06-11 at 11.10.28 AM.png

    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.

    Screen Shot 2016-06-11 at 11.09.20 AM.png

    Tested with OS X Yosemite 10.10.5 and El Capitan 10.11.3

  • by Edenthor,

    Edenthor Edenthor Jun 11, 2016 3:47 PM in response to Roote
    Level 1 (4 points)
    Mac OS X
    Jun 11, 2016 3:47 PM in response to Roote

    Thank you very much.