Skip to content

Instantly share code, notes, and snippets.

@rumpl
Created March 26, 2020 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rumpl/c57aedfc9e88fd4605890e9c5e62d1ea to your computer and use it in GitHub Desktop.
Save rumpl/c57aedfc9e88fd4605890e9c5e62d1ea to your computer and use it in GitHub Desktop.
function toggleZoomMute()
local zoom = hs.appfinder.appFromName("zoom.us")
if (zoom == nil) then
return
end
local unmute = {"Meeting", "Unmute Audio"}
local mute = {"Meeting", "Mute Audio"}
if (zoom:findMenuItem(mute)) then
zoom:selectMenuItem(mute)
hs.alert.show("Zoom Muted")
elseif (zoom:findMenuItem(unmute)) then
zoom:selectMenuItem(unmute)
hs.alert.show("Zoom Unmuted")
end
end
function toggleZoomVideo()
local zoom = hs.appfinder.appFromName("zoom.us")
if (zoom == nil) then
return
end
local stop = {"Meeting", "Stop Video"}
local start = {"Meeting", "Start Video"}
if (zoom:findMenuItem(start)) then
zoom:selectMenuItem(start)
hs.alert.show("Video started")
elseif (zoom:findMenuItem(stop)) then
zoom:selectMenuItem(stop)
hs.alert.show("Video stopped")
end
end
hs.hotkey.bind({"cmd", "shift"}, "A", function()
toggleZoomMute()
end)
hs.hotkey.bind({"cmd", "shift"}, "V", function()
toggleZoomVideo()
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment