HackerTrans
TopNewTrendsCommentsPastAskShowJobs

0rca

no profile record

comments

0rca
·4 tahun yang lalu·discuss
For MacOS there is Hammerspoon, that provides immensely powerful scripting, but can merely open and close the apps, too.

  -- ~/.hammerspoon/init.lua
  function define_shortcut(appName, key, mod)
    hs.hotkey.bind(mod, key, function()
      hs.application.enableSpotlightForNameSearches(true)
      local app = hs.application.find(appName)
      if app and app:isFrontmost() then
        app:hide()
      else
        hs.application.open(appName)
      end
    end)
  end

  define_shortcut("Alacritty", "F1", {})
  define_shortcut("Firefox", "F2", {})