Skip to content

Instantly share code, notes, and snippets.

@Makishima
Created April 3, 2025 11:39
Show Gist options
  • Select an option

  • Save Makishima/87aa533be12aa70c40a81e4fee54598c to your computer and use it in GitHub Desktop.

Select an option

Save Makishima/87aa533be12aa70c40a81e4fee54598c to your computer and use it in GitHub Desktop.
Microphone mute plugin for Flic MacOS App

First you need create plugin folder at ~/Library/Application Scripts/com.shortcutlabs.FlicMac, for example microphoneMutePlugin

mkdir -p "~/Library/Application Scripts/com.shortcutlabs.FlicMac/microphoneMutePlugin"

Now cd into it

cd "~/Library/Application Scripts/com.shortcutlabs.FlicMac/microphoneMutePlugin"

Then add config.json file with following content:

{
	"pluginName": "Microphone mute",
	"pluginDescription": "Helps muting microphone",
	"pluginReadMore": "This plugin help muted input volume",
	"protocolVersion": 1,
	"actions":
	[
		{
			"actionName": "Toggle mute",
			"fileName": "toggleMute.sh"
		},
		{
			"actionName": "Mute",
			"fileName": "mute.sh"
		},
		{
			"actionName": "Unmute",
			"fileName": "unmute.sh"
		}
	]
}

After that add three sh file

  1. toggleMute.sh
#!/bin/sh

currentInputVolume=$(osascript -e "input volume of (get volume settings)")

if (($currentInputVolume > 0))
then
    osascript -e "set volume input volume 0"
    osascript -e 'display notification "Volume set to '$(osascript -e "input volume of (get volume settings)")'" with title "❌ Microphone is off"'

elif (($currentInputVolume == 0))
then
    osascript -e "set volume input volume 100"
    osascript -e 'display notification "Volume set to '$(osascript -e "input volume of (get volume settings)")'" with title "✅ Microphone is on"'
fi
  1. mute.sh
#!/bin/sh

osascript -e "set volume input volume 0"
osascript -e 'display notification "Volume set to '$(osascript -e "input volume of (get volume settings)")'" with title "❌ Microphone is off"'
  1. unmute.sh
#!/bin/sh

osascript -e "set volume input volume 100"
osascript -e 'display notification "Volume set to '$(osascript -e "input volume of (get volume settings)")'" with title "✅ Microphone is on"'

Next step is set sh permissions to allow its execution chmod +x ./*.sh

Finally restart Flic app and plugin will be available as custom one - I use click to mute and double click to unmute

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