How to assign command to mouse middle-click in Ubuntu?

1

TL;DR version

Does anyone know how to assign a command to a mouse action (e.g. holding middle-mouse-button)?

Like this: hold down middle-mouse-button, command #1, release middle-mouse-button, command #2

Long version

At this point I'm using Mangler (Ventrilo-client) to chat, and I have my middle-mouse-button button assigned as "push to speak". But, here's the thing, I like to play music at the same time (Rhythmbox). So I'd like to mute Rhythmbox while I'm talking on Mangler.

I have already found the commands to mute/unmute Rhythmbox using rhythmbox-client --mute and rhythmbox-client --unmute, but I haven't found any way to attach a command to a mouse action.

If someone manages to use rhythmbox-client --set-volume to temporarily lower the volume when someone is talking on Mangler; that would be awesome!

levivanzele

Posted 2011-08-19T18:20:38.750

Reputation: 113

Since I don't know the answer, I will just add the comment that Mumble will mute your other applications when you PTT for you. Or when someone else talks for that matter – EBGreen – 2011-08-19T18:24:00.913

Answers

0

IronAHK can do this. Just create the marco that you want, and then bind it to the middle mouse. You should be able to bind it to the on key up and on key down events.

soandos

Posted 2011-08-19T18:20:38.750

Reputation: 22 744

Updated for ubuntu, sorry, didn't see the tag before. – soandos – 2011-08-19T18:42:30.197