Hammerspoon / hammerspoon

Staggeringly powerful macOS desktop automation with Lua

Home Page:http://www.hammerspoon.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hs.execute window opens in background

hegga opened this issue · comments

Hi!

First, thank you very much for an incredible piece of software!

I have a keybinding which opens the Alacritty terminal and executes a script, my problem is that often the Alacritty window opens in the background of for example the browser which has focus when I press the keybinding. Is there any way I can avoid this? This makes me having to Cmd+Tab to focus the Alacritty window.

The keybinding looks like this:

hs.hotkey.bind({ "cmd" }, "P", function()
  hs.execute("/Applications/Alacritty.app/Contents/MacOS/alacritty --command ~/bin/fuzzy_pass.sh")
end)