Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

address Monterey changes causing TimeMachineProgress to error #266

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading