Skip to content

Commit

Permalink
✨ Add MS Teams support for MicMute Spoon (#306)
Browse files Browse the repository at this point in the history
* ✨ add support for teams mic muting

* ⬆️ increment MicMute version to 1.1
  • Loading branch information
rshmhrj committed Jul 17, 2023
1 parent 85c47f7 commit 8dd7400
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Source/MicMute.spoon/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ obj.__index = obj

-- Metadata
obj.name = "MicMute"
obj.version = "1.0"
obj.version = "1.1"
obj.author = "dctucker <[email protected]>"
obj.homepage = "https://dctucker.com"
obj.license = "MIT - https://opensource.org/licenses/MIT"
Expand All @@ -34,6 +34,7 @@ end
function obj:toggleMicMute()
local mic = hs.audiodevice.defaultInputDevice()
local zoom = hs.application'Zoom'
local teams = hs.application.find("com.microsoft.teams")
if mic:muted() then
mic:setInputMuted(false)
if zoom then
Expand All @@ -44,6 +45,14 @@ function obj:toggleMicMute()
end)
end
end
if teams then
local ok = teams:selectMenuItem'Unmute'
if not ok then
hs.timer.doAfter(0.5, function()
hs.eventtap.keyStroke({"cmd","shift"}, "m", 0, teams)
end)
end
end
else
mic:setInputMuted(true)
if zoom then
Expand All @@ -54,6 +63,14 @@ function obj:toggleMicMute()
end)
end
end
if teams then
local ok = teams:selectMenuItem'Mute'
if not ok then
hs.timer.doAfter(0.5, function()
hs.eventtap.keyStroke({"cmd","shift"}, "m", 0, teams)
end)
end
end
end
obj:updateMicMute(-1)
end
Expand Down
Binary file modified Spoons/MicMute.spoon.zip
Binary file not shown.

0 comments on commit 8dd7400

Please sign in to comment.