-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add MS Teams support for MicMute Spoon (#306)
* ✨ add support for teams mic muting * ⬆️ increment MicMute version to 1.1
- Loading branch information
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
Binary file not shown.