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

WIndow/Process title specific settings possible? #4040

Open
Risinggoblin opened this issue Dec 3, 2024 · 0 comments
Open

WIndow/Process title specific settings possible? #4040

Risinggoblin opened this issue Dec 3, 2024 · 0 comments

Comments

@Risinggoblin
Copy link

I went through the docs and as fas I could gather, We can set up conditions for front most application on macOS. Is it possible to extend this such that this condition only applies to a specific window title?

I only want to remap soem keys when Spelling and Grammar dialog is active and that unfortunately doesn't show up as a separate application/bundle when I try to see the "Frontmost Applications" events in events viewer. However, it does show up as a different window/process title. You can use this zsh code to see a log of what I mean by window/process title:

while true; do
    focused=$(osascript -e '
        tell application "System Events"
            set frontApp to name of first application process whose frontmost is true
            try
                set windowTitle to name of front window of application process frontApp
            on error
                set windowTitle to "(No active window)"
            end try
            return frontApp & ": " & windowTitle
        end tell
    ')
    echo "$(date): $focused"
    sleep 1
done
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