[230314] my first Hammer Spoon lua code

I haven't used Lua language. but it's simple is that. I love it.

function openApplication(str)
  hs.application.open(str)
end

function bindApp(modifierSet, key, appName)
  hs.hotkey.bind(
    modifierSet,
    key,
    function()
      openApplication(appName)
    end)
end

function bindAppInFnKey(key, appName)
  bindApp({"cnd"}, key, appName)
end

bindAppInFnKey("e", "Emacs")
bindAppInFnKey("i", "Google Chrome")
bindAppInFnKey("k", "KakaoTalk")

Author: Younghwan Nam

Created: 2024-04-16 Tue 10:05

Emacs 27.2 (Org mode 9.4.4)

Validate