How to add a global mute (and un-mute) button for Microsoft Teams on macOS

The problem

Do you know the problem when you're in a Microsoft Teams call, you are on mute and working on something. Suddenly a question comes in, and you have to search for the Teams window and trying to find the unmute button.

The Solution

Here is a little script for macOS that does the following:

  • Adds a menubar icon you can click to bring the Teams window to the foreground
  • Adds a menubar text you can click to toggle mute on Teams, even if its somewhere in the background
  • Adds the global shortcut Ctrl-§ which also toggles mute on Teams globally


If Teams is minimized, the buttons and shortcut don't work, so just alt-tab out of Teams, don't minimize it.

As a little bonus, it will also toggle mute on Zoom if you use that.


Install Hammerspoon:

Start it, and open the config:

It will open the empty init.lua file in your editor. Add the following snippet:

-- Mute Button
local muteButton =
muteButton:setTitle("Mute Toggle")

function toggleMute() 
  local teams = hs.application.find("")
  if not (teams == null) then
    hs.eventtap.keyStroke({"cmd","shift"}, "m", 0, teams)
  -- While we're at it, also support zoom
  local zoom = hs.application.find("us.zoom.xos")
   if not (zoom == nil) then
    hs.eventtap.keyStroke({"cmd","shift"}, "a", 0, zoom)



-- Edit here, if you want other modifiers or a different hotkey:
-- Example: local modifiers = {"cmd", "alt", "ctrl", "shift"}
--          hs.hotkey.bind(modifiers, "a", toggleMute)
local modifiers = {"ctrl"}
hs.hotkey.bind(modifiers, "§", toggleMute)

-- Teams Show Button
local teamsShowButton =
local logo = hs.image.imageFromAppBundle("")

function showTeams() 
  local teams = hs.application.find("")
  if not (teams == null) then


Reload the config:

Then you will have two now buttons on your menubar:

The icon is to bring Teams to the foreground, "Mute Toggle" is to toggle the mute function on Teams.

You may also like

Comments are closed.

More in:Internet