Skip to content

Instantly share code, notes, and snippets.

@henrik242
Last active January 27, 2026 23:44
Show Gist options
  • Select an option

  • Save henrik242/1c5010734d6993123d276c3e4d07852f to your computer and use it in GitHub Desktop.

Select an option

Save henrik242/1c5010734d6993123d276c3e4d07852f to your computer and use it in GitHub Desktop.
  1. Open Automator.app
  2. Create new Quick Action
  3. Select Run AppleScript
  4. Add this:
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
	set inputVolume to 100
	display notification "Volume set to 100" with title "✅ Microphone is on"
else
	set inputVolume to 0
	display notification "Volume set to 0" with title "❌ Microphone is off"
end if
set volume input volume inputVolume
  1. Save as mute-microphone
  2. Go to System Preferences -> Keyboard -> Shortcuts -> Services -> General
  3. Find the mute-microphone service and set the hotkey (e.g. control-cmd-option M)
@mediowen
Copy link

mediowen commented Jul 23, 2025

Now we need to have Apple make this a default thing for MacOS, with an option to have the mic icon on the menu bar as well

I meant to follow up on this gist tbh, but in the end I ended up building a whole Hammerspoon script: https://github.com/chessmango/SimpleMicMute.spoon

I wanted a bit more out of it and speed was an issue for me, so fitting into a known-good framework for this type of thing felt more fitting. I've been using it since just before my last commit successfully, with a nice menubar indicator.

@charlesngeru
Copy link

Now we need to have Apple make this a default thing for MacOS, with an option to have the mic icon on the menu bar as well

I meant to follow up on this gist tbh, but in the end I ended up building a whole Hammerspoon script: https://github.com/chessmango/SimpleMicMute.spoon

I wanted a bit more out of it and speed was an issue for me, so fitting into a known-good framework for this type of thing felt more fitting. I've been using it since just before my last commit successfully, with a nice menubar indicator.

This looks good, thanks for sharing, I definitely will try it out. The menubar indicator could also be really useful to me.

@bmp-jaller
Copy link

on getMicrophoneVolume()
input volume of (get volume settings)
end getMicrophoneVolume
on disableMicrophone()
set volume input volume 0
display notification "❌" with title "Microphone is off"
end disableMicrophone
on enableMicrophone()
set volume input volume 100
display notification "✅" with title "Microphone is on"
end enableMicrophone

if getMicrophoneVolume() is greater than 0 then
disableMicrophone()
else
enableMicrophone()
end if

This is a beautiful script. I had shortcuts run this apple script in some shortcuts and it's just fantastic for my macro keyboard Thanks @IonelLupu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment