Skip to content

Commit

Permalink
bump versioni; address changes Monterey brought on (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanDoughty authored Aug 7, 2024
1 parent c05e813 commit 93fd068
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Source/TimeMachineProgress.spoon/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ obj.__index = obj

-- Metadata
obj.name = "TimeMachineProgress"
obj.version = "0.1"
obj.version = "0.2"
obj.author = "Diego Zamboni <[email protected]>"
obj.homepage = "https://github.com/Hammerspoon/Spoons"
obj.license = "MIT - https://opensource.org/licenses/MIT"
Expand Down Expand Up @@ -132,7 +132,7 @@ function obj:refresh()

-- Identify special states: preparing backup and stopping backup.
local stopping = (data['Stopping'] == '1')
local preparing = (not stopping) and (data['Percent'] == '-1' or data['Percent'] == '0')
local preparing = (not stopping) and (data['Percent'] == '-1' or data['Percent'] == '0' or not data['Progress'])

-- Depending on macOS version the 'Progress' data may be stored in a
-- subitem, we promote it to the top level
Expand All @@ -148,7 +148,11 @@ function obj:refresh()
topmenu = tooltip
elseif preparing then
title = "(prep)"
tooltip = "Preparing Backup…"
if (data['BackupPhase']) then
tooltip = data['BackupPhase']:gsub("(%l)(%u)", "%1 %2")
else
tooltip = "Preparing Backup…"
end
topmenu = tooltip
else
title = string.format("%.2f%%", tonumber(data['Percent'])*100)
Expand Down

0 comments on commit 93fd068

Please sign in to comment.