A quick guide to setting up keyboard shortcuts for a push-to-talk microphone.
-
Install xbindkeys:
sudo apt install xbindkeys
-
Find the required keycode for
xbindkeys
:touch $HOME/.xbindkeysrc xbindkeys --key
-
Find the keycode for using with
xset
:xmodmap -pk | grep -i pause
-
Create xbindkeys config file:
This keyshortcut setup disables repeat for Pause using xset and then sets the default source to unmute on Pause key press and mute on Pause key release, I also setup for convenience Scroll_Lock to toggle mute.
vim $HOME/.xbindkeysrc "xset -r 127 && pactl set-source-mute @DEFAULT_SOURCE@ 0" Pause "pactl set-source-mute @DEFAULT_SOURCE@ 1" Pause + release "pactl set-source-mute @DEFAULT_SOURCE@ toggle" Scroll_Lock
Note: You can change
@DEFAULT_SOURCE@
to specific source name or index. -
To test config re-start xbindkeys:
pkill xbindkeys && xbindkeys