I finally wrote an app called Clutch to add this feature to Transmission! It is a separate app so you don't have to worry about patching, and it will continue to work when new updates to Transmission are released.
How does it work?
Transmission has a hidden option in its preferences file called "BindAddressIPv4" (and IPv6), which allows you to bind Transmission to an IP address. This is a nice feature, but it's a major inconvenience to have to update this address every time you start a new VPN connection. Clutch takes care of this for you!
The app has 2 parts:
- Clutch is the GUI part of the app and allows you to select the interface you want to bind Transmission to.
- Clutch Agent runs in the background (it has an icon in the menu bar) and monitors the IP address of the binding interface. When the IP address changes, it will update the binding IP address in Transmission's preferences and restart Transmission if it was running. There is also an option to start Clutch Agent automatically when you log in.
- Clutch can now restart Transmission gracefully without using force-quit. This prevents you from losing your progress or torrent settings when Clutch has to restart Transmission. Enable this feature in Clutch for setup instructions.
- Added regex support for interface names. Be sure to use real regex and not shell glob. For example, enter utun.* instead of utun* if you want to use regex.
- Added a nice loading animation while Transmission is binding/unbinding
- Clutch now updates the list of interfaces each time you open the dropdown
- Fixed a bug where Transmission wouldn't restart if the bar menu was open
- Clutch now uses the new Mac OS hardened runtime
- Other minor bug fixes and performance improvements
- This version automatically checks for updates and allows you to update Clutch automatically within the app!
- It also fixes the issue found by @davids: Clutch now restarts Transmission if your binding interface disappears and reappears without changing its IP. This fixes an issue where Transmission would fail to bind to your VPN if it started before the interface was online (this could happen on boot if Transmission opened before your VPN started)
- Support for Dark Mode (colors have been adjusted to work in both Light and Dark Mode)
- You can now resize the window (uses AutoLayout so the UI is perfect)
- Other UI improvements
- Clutch now treats interfaces with the same name but different IPv4/IPv6 statuses as separate interfaces, preventing any traffic from accidentally being sent in the clear if a VPN doesn't support IPv6.
- Initial release
You can download the app here (move it to your Applications folder):
https://github.com/hbwhite/Clutch/relea ... h-v1.4.zip
Clutch is fully open-source, so you can inspect the code yourself. I have licensed it under the BSD license and posted the full source code here:
Like the app?
If you like the Clutch app, post a message here so more people can find it! Thanks!