<commit_before>local module = {
--[=[
    _NAME        = 'key_bindings.lua',
    _VERSION     = '0.1',
    _URL         = 'https://github.com/asmagill/hammerspoon-config',
    _DESCRIPTION = [[ personal keybindings for hammerspoon ]],
    _TODO        = [[]],
    _LICENSE     = [[ See README.md ]]
--]=]
}

-- private variables and methods -----------------------------------------

local mods        = require("hs._asm.extras").mods
local hotkey      = require("hs.hotkey")
local fnutils     = require("hs.fnutils")
local application = require("hs.application")
local alert       = require("hs.alert")

local app = hotkey.modal.new(mods.CAsC, "a")

    fnutils.each({
        { key = "a", app = "Arduino" },
        { key = "p", app = "Activity Monitor" },
        { key = "t", app = "Terminal" },
        { key = "e", app = "TextWrangler" },
        { key = "f", app = "Finder" },
        { key = "m", app = "Mail" },
        { key = "s", app = "Safari" },
        { key = "c", app = "Console" },
    },
        function(object)
            app:bind(mods.casc, object.key,
                function() application.launchOrFocus(object.app) end,
                function() app:exit() end
            )
        end
    )

    function app:entered()
        if alert.closeSpecific then
            app.alertUUID = alert("Application Selection Mode", true)
        else
            alert("Entering Application Mode")
        end
    end
    function app:exited()
        if app.alertUUID then
            alert.closeSpecific(app.alertUUID)
        else
            alert("Leaving Application Mode")
        end
    end
app:bind(mods.casc, "ESCAPE", function() app:exit() end)

-- Public interface ------------------------------------------------------
-- Return Module Object --------------------------------------------------

return module<commit_msg>additional comments<commit_after>local module = {
--[=[
    _NAME        = 'key_bindings.lua',
    _VERSION     = '0.1',
    _URL         = 'https://github.com/asmagill/hammerspoon-config',
    _DESCRIPTION = [[ personal keybindings for hammerspoon ]],
    _TODO        = [[]],
    _LICENSE     = [[ See README.md ]]
--]=]
}

-- private variables and methods -----------------------------------------

local mods        = require("hs._asm.extras").mods
local hotkey      = require("hs.hotkey")
local fnutils     = require("hs.fnutils")
local application = require("hs.application")
local alert       = require("hs.alert")

local app = hotkey.modal.new(mods.CAsC, "a")

    fnutils.each({
        { key = "a", app = "Arduino" },
        { key = "p", app = "Activity Monitor" },
        { key = "t", app = "Terminal" },
        { key = "e", app = "TextWrangler" },
        { key = "f", app = "Finder" },
        { key = "m", app = "Mail" },
        { key = "s", app = "Safari" },
        { key = "c", app = "Console" },
    },
        function(object)
            app:bind(mods.casc, object.key,
                function() application.launchOrFocus(object.app) end,
                function() app:exit() end
            )
        end
    )

    function app:entered()
-- checks to see if we're using the new one or not; this way this will work even if I disable it in `init.lua`
        if alert.closeSpecific then
-- app is the modal hotkey we created, and since it's a table, its as good a place as any to store something, as long as we don't overwrite any of its required internals (see `hs.inspect(hs.hotkey.modal.new({"ctrl","shift"}, "a"), {metatables = true})` if you want to see what these are)
            app.alertUUID = alert("Application Selection Mode", true)
        else
            alert("Entering Application Mode")
        end
    end
    function app:exited()
        if app.alertUUID then
            alert.closeSpecific(app.alertUUID)
        else
            alert("Leaving Application Mode")
        end
    end
app:bind(mods.casc, "ESCAPE", function() app:exit() end)

-- Public interface ------------------------------------------------------
-- Return Module Object --------------------------------------------------

return module
{'fraction_non_alphanumeric': 0.20170523751522534, 'fraction_numerical': 0.00097442143727162, 'mean_word_length': 1.713813615333774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6411367', 'n_tokens_mistral': 1194, 'n_tokens_neox': 1176, 'n_words': 317}