local status, hyperModeAppMappings = pcall(require, 'keyboard.hyper-apps')

if not status then
  hyperModeAppMappings = require('keyboard.hyper-apps-defaults')
end

for i, mapping in ipairs(hyperModeAppMappings) do
  hs.hotkey.bind({'shift', 'ctrl', 'alt', 'cmd'}, mapping[1], function()
    local appName = mapping[2]
    local app = hs.application.get(appName)
    if app then
      app:activate()
    else
      hs.application.launchOrFocus(appName)
    end
  end)
end

local status, hyperModeAppMappings = pcall(require, 'keyboard.hyper-apps')

if not status then
  hyperModeAppMappings = require('keyboard.hyper-apps-defaults')
end

for i, mapping in ipairs(hyperModeAppMappings) do
  hs.hotkey.bind({'shift', 'ctrl', 'alt', 'cmd'}, mapping[1], function()
    hs.application.launchOrFocus(mapping[2])
  end)
end

Revert 'Fix "launchOrFocus" behavior for Atom'
Revert 'Fix "launchOrFocus" behavior for Atom'

Revert 4f7a69f9bf1fb233e5bc98c1db3e45de2d22c0ff. While that commit did
improve things for Atom, it made things worse for other apps like Chrome
and Finder. With those apps, if the app is open but no windows exist,
the changes in 4f7a69f9bf1fb233e5bc98c1db3e45de2d22c0ff would focus the
app but wouldn't display a window. Chrome with no window isn't
particularly useful. 😬
