docs » CountDown

Countdown with visual indicator

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

API Overview

API Documentation

Variables

alertAttributes
Signature CountDown.alertAttributes
Type Variable
Description

how to display timer is up notification

Source Source/CountDown.spoon/init.lua line 98
alertLen
Signature CountDown.alertLen
Type Variable
Description

time to show the end-of-time alert. 0 implies do not show

Source Source/CountDown.spoon/init.lua line 88
alertSound
Signature CountDown.alertSound
Type Variable
Description

Sounds to play when time is up. No sound if nil

Source Source/CountDown.spoon/init.lua line 93
barCanvasHeight
Signature CountDown.barCanvasHeight
Type Variable
Description

indicator bar at the bottom of the screen

Source Source/CountDown.spoon/init.lua line 66
barFillColorPassed
Signature CountDown.barFillColorPassed
Type Variable
Description

Color for time passed in progress bar

Source Source/CountDown.spoon/init.lua line 76
barFillColorToPass
Signature CountDown.barFillColorToPass
Type Variable
Description

Color for time to pass in progress bar

Source Source/CountDown.spoon/init.lua line 81
barTransparency
Signature CountDown.barTransparency
Type Variable
Description

Transparency for progress bar

Source Source/CountDown.spoon/init.lua line 71
defaultKeyBindings
Signature CountDown.defaultKeyBindings
Type Variable
Description

default key bindings

Source Source/CountDown.spoon/init.lua line 44
defaultLenMinutes
Signature CountDown.defaultLenMinutes
Type Variable
Description

Default timer in minutes.

Source Source/CountDown.spoon/init.lua line 29
messageAttributes
Signature CountDown.messageAttributes
Type Variable
Description

Properties of progress message

Source Source/CountDown.spoon/init.lua line 59
messageDuration
Signature CountDown.messageDuration
Type Variable
Description

Duration of notification messages

Source Source/CountDown.spoon/init.lua line 54
nofity
Signature CountDown.nofity
Type Variable
Description

set to nil to turn off notification when time's up or provide a hs.notify notification

Source Source/CountDown.spoon/init.lua line 39
useLastTimerAsDefault
Signature CountDown.useLastTimerAsDefault
Type Variable
Description

if true, make defaultLenMinutes the last time length used

Source Source/CountDown.spoon/init.lua line 34
warningFormat
Signature CountDown.warningFormat
Type Variable
Description

Format to display the warning.

Source Source/CountDown.spoon/init.lua line 112
warningShow
Signature CountDown.warningShow
Type Variable
Description

Do we show progress warnings. A progress warning happens

Source Source/CountDown.spoon/init.lua line 105
warningshowDuration
Signature CountDown.warningshowDuration
Type Variable
Description

for how many seconds to show the warning

Source Source/CountDown.spoon/init.lua line 118

Methods

bindHotkeys
Signature CountDown:bindHotkeys(mapping)
Type Method
Description

Bind hotkeys for this spoon

Parameters
  • mapping: a table with the callbacks
Returns
  • None
Source Source/CountDown.spoon/init.lua line 734
cancel
Signature CountDown:cancel()
Type Method
Description

Reset the timer

Parameters
  • None
Returns
  • None
Source Source/CountDown.spoon/init.lua line 685
pauseOrResume
Signature CountDown:pauseOrResume()
Type Method
Description

Pause or resume the existing countdown.

Parameters
  • None
Returns
  • None
Source Source/CountDown.spoon/init.lua line 642
setProgress
Signature CountDown:setProgress(progress)
Type Method
Description

Set the progress of visual indicator to progress.

Parameters
  • progress a relative number specifying the new progress (0.0 - 1.0)
Returns
  • None
Source Source/CountDown.spoon/init.lua line 707
startFor
Signature CountDown:startFor(minutes, callback)
Type Method
Description

Start a countdown for minutes minutes immediately. Calling this method again will kill the existing countdown instance.

Parameters
  • minutes - How many minutes Defaults to obj.defaultLenMinutes
  • callback: optional: a function to call when the timer is up. it takes one parameters (minutes) the minutes that were requested. The callback is not called if timer is cancelled
Returns
  • None
Source Source/CountDown.spoon/init.lua line 512
startUntil
Signature CountDown:startUntil(time)
Type Method
Description

Start a countdown until time indicated in parameter.

Parameters
  • callback: optional: a function to call when the timer is up. it takes one parameters (minutes) the minutes that were requested.
Returns
Source Source/CountDown.spoon/init.lua line 604