Is there a way to have a gesture for mute that does not also unmute?

I wanted to add it to my locking gesture so that when I walk away it locks my computer and also makes sure it doesn't distract people if I get a call but unfortunately it currently also unmute's my laptop so that it plays sound if I originally had it on mute. Any help would be really appreciated.

Is there a solution to this by now? Can I check the mute status as condition for trigger?

You can initiate an Applescript with a trigger. Something like this, for example.

set volumeInfo to (do shell script "osascript -e 'get volume settings'")
if volumeInfo contains "output muted:true" then
display dialog "The output is currently muted."
else
display dialog "The output is not muted."
end if

FYI: You don't need to run a shell script inside of the Apple Script:

set volumeInfo to output muted of (get volume settings)
if volumeInfo is true then
	display dialog "The output is currently muted."
else
	display dialog "The output is not muted."
end if

If you want to use the muted state as a condition, you need to create a dynamic java script variable in the "Automations, Named & Other Triggers" section. This can then be used in the advanced trigger conditions.

let  result = await runAppleScript('output muted of (get volume settings)')

if(result === "true")  {
returnVariableValue("muted")
} else {
returnVariableValue("not muted")

}