hammerspoon
hammerspoon copied to clipboard
hs.execute window opens in background
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)
Try adding the following after the execute statement:
hs.application.launchOrFocus("Alacritty")