![]() ![]() a key-value table in which the keys are the UUIDs for the current screens and the value for each key is the space ID of the active space for that display.Returns a key-value table specifying the active spaces for all screens. Hs.spaces.activeSpaces() -> table | nil, error an integer specifying the ID of the space displayed, or nil and an error message if an error occurs.If no screen is specified, the screen returned by hs.screen.mainScreen() is used. The screen may be specified by its ID ( hs.screen:id()), its UUID ( hs.screen:getUUID()), the string "Main" (a shortcut for hs.screen.mainScreen()), the string "Primary" (a shortcut for hs.screen.primaryScreen()), or as an hs.screen object. screen - an optional screen specification identifying the screen to return the active space for.Returns the currently visible (active) space for the specified screen. Hs.spaces.activeSpaceOnScreen() -> integer | nil, error Once you have found a value that works reliably on your system, you can use hs.tDefaultMCwaitTime to make it the default value for your system each time the hs.spaces module is loaded.If you find that the above mentioned functions do not work reliably with your setup, you can try adjusting this variable upwards - the down side is that the larger this value is, the longer the Mission Control display is visible before returning the user to what they were working on. ![]() Experimentation on my machine has found that 0.3 seconds provides sufficient time for reliable functionality. This variable specifies how long to delay before performing the action to complete the function. The above mentioned functions require that the Mission Control accessibility objects be fully formed before the necessary action can be triggered.Specifies how long to delay before performing the accessibility actions for hs.spaces.gotoSpace and hs.spaces.removeSpace Functions - API calls offered directly by the extensionĪPI Documentation Variables MCwaitTime Signature.If you require more sophisticated control, I encourage you to check out - it does require some additional setup (changes to SIP, possibly edits to sudoers, etc.) but may be worth the extra steps for some power users. This module is a distillation of my previous hs._ module, changes inspired by reviewing the Yabai source, and some experimentation with hs.axuielement. It is recommended that you also enable "Displays have separate Spaces" in System Preferences -> Mission Control. You can minimize, but not entirely remove, this by enabling "Reduce motion" in System Preferences -> Accessibility -> Display. Because we are essentially directing the Dock to perform User Interactions, there is some visual feedback which we cannot entirely suppress. The functions which allow you to create new spaes, remove spaces, and jump to a specific space utilize hs.axuielement and perform accessibility actions through the Dock application to manipulate Mission Control. It should be noted that while the functions provided by this module have worked for some time in third party applications and in a previous experimental module that has received limited testing over the last few years, they do utilize some private APIs which means that Apple could change them at any time. By using a combination of private APIs and Accessibility hacks (via hs.axuielement), some basic functions for controlling the use of Spaces is possible with Hammerspoon, but there are some limitations and caveats. The functionality provided by this module is considered experimental and subject to change. ![]() This module provides some basic functions for controlling macOS Spaces. Hammerspoon docs: hs.spaces docs » hs.spaces ![]()
0 Comments
Leave a Reply. |