Skip to content

Instantly share code, notes, and snippets.

@tabidots
Last active September 21, 2025 19:38
Show Gist options
  • Select an option

  • Save tabidots/d97c69d5d667fa0302617522eb5b08df to your computer and use it in GitHub Desktop.

Select an option

Save tabidots/d97c69d5d667fa0302617522eb5b08df to your computer and use it in GitHub Desktop.
Karabiner-Elements rule to get Safari to close a tab even when W is mapped to a non-alpha key
{
"description": "Fix Safari ⌘W close tab when using custom layout",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Safari$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "w",
"modifiers": { "mandatory": ["command"] }
},
"to": [{ "shell_command": "osascript -e 'tell application \"Safari\" to tell front window to close current tab'" }],
"type": "basic"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment