I started by patching mumble to support the dbus calls:
{
environment.systemPackages = [
(pkgs.mumble.overrideAttrs (oa: {
patches = oa.patches ++ [
(pkgs.fetchpatch {
url = "https://github.com/mumble-voip/mumble/pull/3675.patch";
sha256 = "1zmqb8gl2cp0mcw85x9wn5rjw2mih7d2x96jxxqabjcx1kvgyhh3";
})
];
}))
];
}
Then I've added the following lines to my sway configuration:
bindsym --no-repeat Super_L exec gdbus call -e -d net.sourceforge.mumble.mumble -o / -m net.sourceforge.mumble.Mumble.startTalking
bindsym --no-repeat --release Super_L exec gdbus call -e -d net.sourceforge.mumble.mumble -o / -m net.sourceforge.mumble.Mumble.stopTalking
(Note, gdbus
comes from the package glib
)
Now you can launch up Mumble, you don't have to actually bind any keybinding
for this to work since it's not actually a key bind but a dbus event. This
also means that you can't test this while not connected to a server. When
connected to a server and in a room where you have permissions to speak it
works perfectly fine like a Push To Talk button.