<commit_before>
-- shift (⇧ ); control/crtl (⌃); option/alt (⌥ ); command/cmd (⌘ )
local scod = {"shift","ctrl","alt","cmd"}
local cd = {"ctrl","cmd"}
local cod = {"ctrl","alt","cmd"}

-- redshift to 2800K from 20:30->21:30
-- and back to standard 6:30->7:30
hs.redshift.start(2800,'21:00','7:00','1h')

function reloadPlusAlert()
    hs.reload()
    hs.alert.show("Hammerspoon config has been reloaded")
end

--config reloading. manual (from getting started guide):
hs.hotkey.bind(cod, "R", function()
    reloadPlusAlert()
end)


-- menu icon to access Mac's caffeine functions
local caffeine = hs.menubar.new()

function setCaffeineDisplay(state)
    local result
    if state then
        result = caffeine:setIcon("assets/stay-awake.pdf")
        caffeine:setTooltip("Caffeine is on - Mac won't sleep")
    else
        result = caffeine:setIcon("assets/can-sleep.pdf")
        caffeine:setTooltip("Caffeine is off - Mac is allowed to sleep")
    end
end

function caffeineClicked()
    setCaffeineDisplay(hs.caffeinate.toggle("displayIdle"))
end

if caffeine then
    caffeine:setClickCallback(caffeineClicked)
    -- enable caffeine and prevent sleep by default
    hs.caffeinate.set('displayIdle', true, true)
    setCaffeineDisplay(hs.caffeinate.get("displayIdle"))
end

-- watch & reload config automatically if changed
function reloadConfig(files)
    doReload = false
    for _,file in pairs(files) do
        if file:sub(-4) == ".lua" then
            doReload = true
        end
    end
    if doReload then
        reloadPlusAlert()
    end
end
hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", reloadConfig):start()


-- Windows
-- Toggle a window regular frame and maximized on the screen<commit_msg>Make sure hammerspoon pathwatcher also checks this repo's lua's<commit_after>
-- shift (⇧ ); control/crtl (⌃); option/alt (⌥ ); command/cmd (⌘ )
local scod = {"shift","ctrl","alt","cmd"}
local cd = {"ctrl","cmd"}
local cod = {"ctrl","alt","cmd"}

-- redshift to 2800K from 20:30->21:30
-- and back to standard 6:30->7:30
hs.redshift.start(2800,'21:00','7:00','1h')

function reloadPlusAlert()
    hs.reload()
    hs.alert.show("Hammerspoon config has been reloaded")
end

--config reloading. manual (from getting started guide):
hs.hotkey.bind(cod, "R", function()
    reloadPlusAlert()
end)


-- menu icon to access Mac's caffeine functions
local caffeine = hs.menubar.new()

function setCaffeineDisplay(state)
    local result
    if state then
        result = caffeine:setIcon("assets/stay-awake.pdf")
        caffeine:setTooltip("Caffeine is on - Mac won't sleep")
    else
        result = caffeine:setIcon("assets/can-sleep.pdf")
        caffeine:setTooltip("Caffeine is off - Mac is allowed to sleep")
    end
end

function caffeineClicked()
    setCaffeineDisplay(hs.caffeinate.toggle("displayIdle"))
end

if caffeine then
    caffeine:setClickCallback(caffeineClicked)
    -- enable caffeine and prevent sleep by default
    hs.caffeinate.set('displayIdle', true, true)
    setCaffeineDisplay(hs.caffeinate.get("displayIdle"))
end

-- watch & reload config automatically if changed
function reloadConfig(files)
    doReload = false
    for _,file in pairs(files) do
        if file:sub(-4) == ".lua" then
            doReload = true
        end
    end
    if doReload then
        reloadPlusAlert()
    end
end
hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", reloadConfig):start()
hs.pathwatcher.new(os.getenv("HOME") .. "/.homesick/repos/apple.bin/.hammerspoon/", reloadConfig):start()


-- Windows
-- Toggle a window regular frame and maximized on the screen
{'fraction_non_alphanumeric': 0.13449805879090404, 'fraction_numerical': 0.017193566278424846, 'mean_word_length': 3.612531969309463, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '3353871', 'n_tokens_mistral': 1256, 'n_tokens_neox': 1155, 'n_words': 312}