Hammerspoon: Switch to last used app

Created on 20 Jun 2017  路  1Comment  路  Source: Hammerspoon/hammerspoon

I'm trying to have a one button key binding to switch to the last used app, without an app switcher window showing. Like they suggest in this article: http://xahlee.info/linux/why_tiling_window_manager_sucks.html (alt-tab to f4)

I thought this might work, but it gets stuck on the app switcher window:

hs.hotkey.bind({}, "f8", function() hs.eventtap.keyStroke({"cmd"}, "tab", 10); end)

question

Most helpful comment

I think the way I would do this is implement an hs.application.watcher that keeps track of the most recently activated app in a global variable, so you can then just call :activate() on that variable :)

I'm going to close out this issue because I think this should all be possible, but please feel free to re-open it if you run into any problems :)

>All comments

I think the way I would do this is implement an hs.application.watcher that keeps track of the most recently activated app in a global variable, so you can then just call :activate() on that variable :)

I'm going to close out this issue because I think this should all be possible, but please feel free to re-open it if you run into any problems :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BigSully picture BigSully  路  3Comments

aaronjensen picture aaronjensen  路  3Comments

fent picture fent  路  3Comments

asmagill picture asmagill  路  4Comments

lazandrei19 picture lazandrei19  路  4Comments