Linux equivalent of Hammerspoon hs.application.launchOrFocus

Hello fellow archlabers.

While building my Hackintosh setup I got quite used to specific Hammerspoon feature that either launches or focused launched application. It’s a handy way of jumping between fullscreen terminal and code editor, for example.

Is there a way to replicate this in Archlabs?

More info about launchOrFocus http://www.hammerspoon.org/docs/hs.application.html#launchOrFocus

I think you can duplicate that with wmctrl.

This command:

wmctrl -a firefox || firefox

as a keybinding will launch firefox, but if firefox is already running it will raise and focus the window.

That the sort of thing you’re trying to accomplish? May require some more sophisticated scripting to recreate that launchOrFocus module.

1 Like

Thank you, I will definetly try wmctrl.
This is exacly what i was aiming for.