Search IconIcon to open search

You should have instant access to your utility apps

Written April 30, 2022

    What are the apps you use many, many times a day? For me it is Akiflow and Obsidian. Whatever those apps are, you should have instant access to them. The moment your brain realizes you need them, they should be there. With Hammerspoon and a script I’ve thrown together you can toggle that app into focus, do whatever you need to accomplish and put the app away, bringing you right back to what you were doing. Nearly no context switching necessary.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    
    local isAppFocused = function(name)
      app = hs.application.frontmostApplication()
      appName = app:name()
    
      return appName == name
    end
    
    local toggleFocus = function(name)
      if(isAppFocused(name)) then
        app:hide();
      else
        hs.application.launchOrFocus(name)
      end
    end
    
    hs.hotkey.bind({'ctrl'}, 'space', function()
      toggleFocus('Obsidian')
    end)
    

    Interactive Graph