docs » MountedVolumes

Displays a list of mounted volumes and a pie chart for each indicating free space on the desktop

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

API Overview

API Documentation

Variables

backgroundBorder
Signature MountedVolumes.backgroundBorder
Type Variable
Description

A table, as defined in hs.drawing.color, specifying the color of the volume lists border. Defaults to { alpha = .5 }

Source Source/MountedVolumes.spoon/init.lua line 254
backgroundColor
Signature MountedVolumes.backgroundColor
Type Variable
Description

A table, as defined in hs.drawing.color, specifying the color of the volume lists background. Defaults to { alpha = .7, white = .5 }

Source Source/MountedVolumes.spoon/init.lua line 247
capacityColor
Signature MountedVolumes.capacityColor
Type Variable
Description

A table, as defined in hs.drawing.color, specifying the color to use for the in use portion of the volume's capacity pie chart. Defaults to hs.drawing.color.x11.orangered

Notes
  • Changes will take effect when the next volume change occurs, when the next usage check occurs (see MountedVolumes.checkInterval), or when MountedVolumes:show is invoked, whichever occurs first.
Source Source/MountedVolumes.spoon/init.lua line 206
checkInterval
Signature MountedVolumes.checkInterval
Type Variable
Description

A number, default 120, specifying how often in seconds the free space on mounted volumes should be polled for current usage data.

Source Source/MountedVolumes.spoon/init.lua line 240
cornerRadius
Signature MountedVolumes.cornerRadius
Type Variable
Description

A number, default 5, specifying how rounded the corners of the volume list background should be.

Source Source/MountedVolumes.spoon/init.lua line 261
enableEjectButton
Signature MountedVolumes.enableEjectButton
Type Variable
Description

A boolean, default true, indicating whether the eject button displayed next to removable volumes is enabled.

Notes
  • Changes will take effect when the next volume change occurs, when the next usage check occurs (see MountedVolumes.checkInterval), or when MountedVolumes:show is invoked, whichever occurs first.
Source Source/MountedVolumes.spoon/init.lua line 198
freeColor
Signature MountedVolumes.freeColor
Type Variable
Description

A table, as defined in hs.drawing.color, specifying the color to use for the free portion of the volume's capacity pie chart. Defaults to hs.drawing.color.x11.mediumspringgreen

Notes
  • Changes will take effect when the next volume change occurs, when the next usage check occurs (see MountedVolumes.checkInterval), or when MountedVolumes:show is invoked, whichever occurs first.
Source Source/MountedVolumes.spoon/init.lua line 214
growsDownwards
Signature MountedVolumes.growsDownwards
Type Variable
Description

A boolean, default true, indicating whether the displayed list grows downwards or upwards as more volumes are mounted.

Notes
  • Note that if this value is true, then MountedVolumes.location specifies the upper left corner of the display. If this value is false, then MountedVolumes.location specifies the bottom left corner of the display.
  • Changes will take effect when the next volume change occurs, when the next usage check occurs (see MountedVolumes.checkInterval), or when MountedVolumes:show is invoked, whichever occurs first.
Source Source/MountedVolumes.spoon/init.lua line 231
location
Signature MountedVolumes.location
Type Variable
Description

A table specifying the location on the screen of the starting corner of the display. Defaults to { x = 20, y = 22 }.

Notes
  • See also MountedValues.growsDownwards.
  • Changes will take effect when the next volume change occurs, when the next usage check occurs (see MountedVolumes.checkInterval), or when MountedVolumes:show is invoked, whichever occurs first.
Source Source/MountedVolumes.spoon/init.lua line 222
textStyle
Signature MountedVolumes.textStyle
Type Variable
Description

A table specifying the style as defined in hs.styledtext to display the volume name and usage details with. Defaults to:

Notes
  • { font = { name = "Menlo", size = 10 }, color = { alpha = 1.0 }, paragraphStyle = { alignment = "center" }, }
  • Changes will take effect when the next volume change occurs, when the next usage check occurs (see MountedVolumes.checkInterval), or when MountedVolumes:show is invoked, whichever occurs first.
Source Source/MountedVolumes.spoon/init.lua line 181
unitsInSI
Signature MountedVolumes.unitsInSI
Type Variable
Description

Boolean, default false, indicating whether capacity is displayed in SI units (1 GB = 10^9 bytes) or Gibibytes (1 GiB = 2^30 bytes).

Source Source/MountedVolumes.spoon/init.lua line 174

Methods

bindHotkeys
Signature MountedVolumes:bindHotkeys(mapping)
Type Method
Description

Binds hotkeys for MountedVolumes

Parameters
  • mapping - A table containing hotkey modifier/key details for one or more of the following commands:
    • "show" - Show the volume list
    • "hide" - Hide the volume list
    • "toggle" - If the volume list is visible then hide it; otherwise show the list.
Returns
  • None
Notes
  • the mapping table is a table of one or more key-value pairs of the format command = { { modifiers }, key } where:
    • command - is one of the commands listed above
    • modifiers - is a table containing keyboard modifiers, as specified in hs.hotkey.bind()
    • key - is a string containing the name of a keyboard key, as specified in hs.hotkey.bind()
Source Source/MountedVolumes.spoon/init.lua line 311
hide
Signature MountedVolumes:hide()
Type Method
Description

Hide the volumes panel on the background and stop watching for volume changes

Parameters
  • None
Returns
  • The MountedVolumes object
Source Source/MountedVolumes.spoon/init.lua line 290
show
Signature MountedVolumes:show()
Type Method
Description

Display the volumes panel on the background and update it as volumes are mounted and unmounted.

Parameters
  • None
Returns
  • The MountedVolumes object
Notes
  • If you make a change to any of the variables defining the visual appearance of the volume list, you can force the change to take immediate effect by invoking this method, even if the volume list is already being displayed.
Source Source/MountedVolumes.spoon/init.lua line 268