docs » TurboBoost

A spoon to load/unload the Turbo Boost Disable kernel extension from https://github.com/rugarciap/Turbo-Boost-Switcher.

Note: this spoon by default uses sudo to load/unload the kernel extension, so for it to work from Hammerspoon, you need to configure sudo to be able to load/unload the extension without a password, or configure the load_kext_cmd and unload_kext_cmd variables to use some other mechanism that prompts you for the credentials.

For example, the following configuration (stored in /etc/sudoers.d/turboboost) can be used to allow loading and unloading the module without a password:

Cmnd_Alias    TURBO_OPS = /sbin/kextunload /Applications/Turbo Boost Switcher.app/Contents/Resources/DisableTurboBoost.64bits.kext, /usr/bin/kextutil /Applications/Turbo Boost Switcher.app/Contents/Resources/DisableTurboBoost.64bits.kext

%admin ALL=(ALL) NOPASSWD: TURBO_OPS

If you use this, please support the author of Turbo Boost Disabler by purchasing the Pro version of the app!

Download: https://github.com/Hammerspoon/Spoons/raw/master/Spoons/TurboBoost.spoon.zip

API Overview

API Documentation

Variables

check_kext_cmd
Signature TurboBoost.check_kext_cmd
Type Variable
Description

Command to execute to check whether the DisableTurboBoost kernel extension is loaded.

Notes
  • Default value: "/usr/sbin/kextstat | grep com.rugarciap.DisableTurboBoost"
Source Source/TurboBoost.spoon/init.lua line 100
disable_on_start
Signature TurboBoost.disable_on_start
Type Variable
Description

Boolean to indicate whether Turbo Boost should be disabled when

Source Source/TurboBoost.spoon/init.lua line 45
disabled_icon_path
Signature TurboBoost.disabled_icon_path
Type Variable
Description

Where to find the icon to use for the "Disabled" icon.

Notes
  • Default value uses the icon from the Turbo Boost application: "/Applications/Turbo Boost Switcher.app/Contents/Resources/icon_off.tiff"
Source Source/TurboBoost.spoon/init.lua line 121
enabled_icon_path
Signature TurboBoost.enabled_icon_path
Type Variable
Description

Where to find the icon to use for the "Enabled" icon.

Notes
  • Default value uses the icon from the Turbo Boost application: "/Applications/Turbo Boost Switcher.app/Contents/Resources/icon.tiff"
Source Source/TurboBoost.spoon/init.lua line 113
kext_path
Signature TurboBoost.kext_path
Type Variable
Description

Where the DisableTurboBoost.kext file is located.

Source Source/TurboBoost.spoon/init.lua line 67
kext_paths
Signature TurboBoost.kext_paths
Type Variable
Description

List with paths to check for the DisableTurboBoost.kext file. The first one

Source Source/TurboBoost.spoon/init.lua line 57
load_kext_cmd
Signature TurboBoost.load_kext_cmd
Type Variable
Description

Command to execute to load the DisableTurboBoost kernel extension.

Notes
  • This command must execute with root privileges and either query the user for the credentials, or be configured (e.g. with sudo) to run without prompting.
  • The string "%s" in this variable gets replaced with the value of TurboBoost.kext_path. Default value: "/usr/bin/sudo /usr/bin/kextutil '%s'"
Source Source/TurboBoost.spoon/init.lua line 82
logger
Signature TurboBoost.logger
Type Variable
Description

Logger object used within the Spoon. Can be accessed to set the default log level for the messages coming from the Spoon.

Source Source/TurboBoost.spoon/init.lua line 37
notify
Signature TurboBoost.notify
Type Variable
Description

Boolean indicating whether notifications should be generated when Turbo Boost is enabled/disabled. Default value: true

Source Source/TurboBoost.spoon/init.lua line 108
reenable_on_stop
Signature TurboBoost.reenable_on_stop
Type Variable
Description

Boolean to indicate whether Turbo Boost should be reenabled when

Source Source/TurboBoost.spoon/init.lua line 51
unload_kext_cmd
Signature TurboBoost.unload_kext_cmd
Type Variable
Description

Command to execute to unload the DisableTurboBoost kernel extension.

Notes
  • This command must execute with root privileges and either query the user for the credentials, or be configured (e.g. with sudo) to run without prompting.
  • The string "%s" in this variable gets replaced with the value of TurboBoost.kext_path. Default value: "/usr/bin/sudo /sbin/kextunload '%s'"
Source Source/TurboBoost.spoon/init.lua line 91

Methods

bindHotkeys
Signature TurboBoost:bindHotkeys(mapping)
Type Method
Description

Binds hotkeys for TurboBoost

Parameters
  • mapping - A table containing hotkey objifier/key details for the following items:
    • hello - Say Hello
Returns
Source Source/TurboBoost.spoon/init.lua line 197
setState
Signature TurboBoost:setState(state, notify)
Type Method
Description

Sets whether Turbo Boost should be disabled (kernel extension loaded) or enabled (normal state, kernel extension not loaded).

Parameters
  • state - A boolean, false if Turbo Boost should be disabled (load kernel extension), true if it should be enabled (unload kernel extension if loaded).
  • notify - Optional boolean indicating whether a notification should be produced. If not given, the value of TurboBoost.notify is used.
Returns
  • Boolean indicating new state
Source Source/TurboBoost.spoon/init.lua line 129
start
Signature TurboBoost:start()
Type Method
Description

Starts TurboBoost

Parameters
  • None
Returns
  • The TurboBoost object
Source Source/TurboBoost.spoon/init.lua line 209
status
Signature TurboBoost:status()
Type Method
Description

Check whether Turbo Boost is enabled

Parameters
  • None
Returns
  • true if TurboBoost is enabled (kernel ext not loaded), false otherwise.
Source Source/TurboBoost.spoon/init.lua line 168
stop
Signature TurboBoost:stop()
Type Method
Description

Stops TurboBoost

Parameters
  • None
Returns
  • The TurboBoost object
Source Source/TurboBoost.spoon/init.lua line 230
toggle
Signature TurboBoost:toggle()
Type Method
Description

Toggle TurboBoost status

Parameters
  • None
Returns
  • New TurboBoost status, after the toggle
Source Source/TurboBoost.spoon/init.lua line 183