Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple Spolight search is not recognized as frontmost application #3794

Open
SamStuckey opened this issue Apr 28, 2024 · 0 comments
Open

Apple Spolight search is not recognized as frontmost application #3794

SamStuckey opened this issue Apr 28, 2024 · 0 comments

Comments

@SamStuckey
Copy link

Description

  • Apple's Spotlight feature does not register as 'frontmost application'
  • Whatever is the 'frontmost application' at the time of a spotlight window opening remains the active 'frontmost application'

Examples

Showing EventViewer not responding to Spotlight
Screenshot 2024-04-28 at 9 11 13 AM

Showing EventViewer tracking Finder as frontmost application before opening spotlight
Screenshot 2024-04-28 at 9 12 17 AM

Showing Event Viewer still tracking Finder as frontmost application with spotlight open again
Screenshot 2024-04-28 at 9 12 23 AM

To Reproduce

  1. Open EventViewer
  2. Open Spotlight with Cmd+Spacebar shortcut

My Goal

I want to map ctrl+n and ctrl+p to my up and down arrows inside of spotlight. So far the best I've come up with is a global mapping with an exception for my terminal programs (Already using those shortcuts for VIM stuff). This works most of the time, unless I open spotlight on top of a terminal window. Terminal (Iterm2, actually) stays active as my frontmost application, disabling my up / down keying within spotlight.

My current config to accomplish this goal

Again, this works unless I try and use the spotlight search on top of a terminal window (which I do often)

  {
    "description": "Use n & p as up and down arrow keys",
    "manipulators": [
      {
        "conditions": [
          {
            "bundle_identifiers": [
              "com.googlecode.iterm2",
              "com.apple.Terminal"
            ],
            "type": "frontmost_application_unless"
          }
        ],
        "type": "basic",
        "from": {
          "key_code": "n",
          "modifiers": {
            "mandatory": [
              "left_control"
            ]
          }
        },
        "to": [
          {
            "key_code": "down_arrow"
          }
        ]
      },
      {
        "conditions": [
          {
            "bundle_identifiers": [
              "com.googlecode.iterm2",
              "com.apple.Terminal"
            ],
            "type": "frontmost_application_unless"
          }
        ],
          "type": "basic",
          "from": {
            "key_code": "p",
            "modifiers": {
              "mandatory": [
                  "left_control"
              ]
            }
          },
          "to": [
            {
              "key_code": "up_arrow"
            }
          ]
      }
    ]
  },

Ideal Outcome

  • When open, Spotlight registers as frontmost application with a unique bundle_identifier that I can use to lock in behavior specific to that spotlight window., e.g.
  {
    "description": "Use n & p as up and down arrow keys",
    "manipulators": [
      {
        "conditions": [
          {
            "bundle_identifiers": [
              "com.apple.Spotlight"
            ],
            "type": "frontmost_application_if"
          }
        ]
        ...
      }
    ]
  },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant