The command to toggle mute/unmute the default microphone using sxhkd is applied at the system level, which means it will affect the default microphone used by all applications.
If you want to use different keybindings for setting push-to-talk in Discord and Teamspeak, you can create separate keybindings for each application in the sxhkdrc configuration file by using the
--class
flag to specify the name of the application window.
Here's an example of a keybinding that sets push-to-talk in Discord when the Control_R key is pressed:
Code:
#Push-to-talk in Discord
ctrl + Control_R
xdotool search --class discord keydown Shift+Control_R
ctrl + Control_R + Release
xdotool search --class discord keyup Shift+Control_R
In this example, the
xdotool
command simulates a key press or release event in a specific application window by using the
search
option to locate the window by class name.
You can use a similar configuration for Teamspeak by replacing the class name
discord
with the class name of the Teamspeak window. You can find the class name of a window by running the
xprop
command and clicking on the window you want to target.
Keep in mind that Discord and Teamspeak may use different key definitions for push-to-talk, so you'll need to check their settings to confirm which key(s) to use.