Try this. I built it from the thread you linked and by looking over the examples at the KE-complex_modifications GitHub repo. I don’t have KE installed so I couldn’t actually test it.
Best to keep each configuration in separate files and out of your main global config file. So save this into ~/.config/karabiner/assets/complex_modifications/teamviewer-swap-cmd-ctrl.json
Go into Karabiner Preferences > Complex Modifications > Add rule then enable “Swap Left Control/Command only in Teamviewer”
{
"title": "Swap Left Control/Command only in Teamviewer",
"rules": [
{
"description": "Left Command to Control",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_command"
},
"to": [
{
"key_code": "left_control"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com.teamviewer.TeamViewer"
]
}
]
}
]
},
{
"description": "Left Control to Command",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_control"
},
"to": [
{
"key_code": "left_command"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com.teamviewer.TeamViewer"
]
}
]
}
]
}
]
}