Read more

Mac: Turn applications to Full Screen mode from bash

Dominik Schöler
January 08, 2013Software engineer at makandra GmbH

I needed a way to make my apps full screen from bash scripts. There is no super-easy way, but it's not too hard either.

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

Put the attached script into e.g. /usr/local/bin and make it executable. Now you can call

fullscreen Safari

and Safari will go full screen.

Notes

  • This script needs activated access for assisting devices. Turn it on with osascript -e 'tell application "System Events" to set UI elements enabled to true'.
  • The capitalization of the application name is important, i.e. it's TextMate and not textmate.
  • The script attempts to fullscreenize the frontmost window of the application.
  • Fullscreenization apparently only works with apps (and windows) that support it.

Toggle

You also may use the script to exit or toggle Full Screen. Just edit the script according to the comments.

Posted by Dominik Schöler to makandra dev (2013-01-08 08:51)