docs » Sweeper

Automatically hide apps that are out of focus.

Download: https://github.com/adammillerio/Spoons/raw/main/Spoons/Sweeper.spoon.zip

This uses a hs.window.filter to detect windows that have gone out of focus. Then, if they are configured to be "swept" in the apps config, they will be automatically hidden if they remain out of focus after sweepCheckInterval (default 15 seconds).

Example Usage (Using SpoonInstall): spoon.SpoonInstall:andUse( "Sweeper", { start = true } )

API Overview

API Documentation

Variables

apps
Signature Sweeper.apps
Type Variable
Description

Table containing each application's name and it's desired configuration. The

Source Source/Sweeper.spoon/init.lua line 29
logger
Signature Sweeper.logger
Type Variable
Description

Logger object used within the Spoon. Can be accessed to set the default log

Source Source/Sweeper.spoon/init.lua line 43
logLevel
Signature Sweeper.logLevel
Type Variable
Description

Sweeper specific log level override, see hs.logger.setLogLevel for options.

Source Source/Sweeper.spoon/init.lua line 49
subscribedFunctions
Signature Sweeper.subscribedFunctions
Type Variable
Description

Table containing all subscribed instance callbacks for the window filter, used

Source Source/Sweeper.spoon/init.lua line 61
sweepCheckInterval
Signature Sweeper.sweepCheckInterval
Type Variable
Description

Time in seconds to wait after a window loses focus to check if it should be swept.

Source Source/Sweeper.spoon/init.lua line 38
windowFilter
Signature Sweeper.windowFilter
Type Variable
Description

Main hs.window.filter. This is what is used to detect and action on unfocused

Source Source/Sweeper.spoon/init.lua line 54

Methods

init
Signature Sweeper:init()
Type Method
Description

Spoon initializer method for Sweeper.

Parameters
  • None
Returns
  • None
Source Source/Sweeper.spoon/init.lua line 67
start
Signature Sweeper:start()
Type Method
Description

Spoon start method for Sweeper.

Parameters
  • None
Returns
  • None
Notes
  • Configures the window filter, and subscribes to all window unfocus events.
Source Source/Sweeper.spoon/init.lua line 159
stop
Signature Sweeper:stop()
Type Method
Description

Spoon stop method for Sweeper.

Parameters
  • None
Returns
  • None
Notes
  • Unsubscribes the window filter from all subscribed functions.
Source Source/Sweeper.spoon/init.lua line 192