Skip to content

Instantly share code, notes, and snippets.

@knu
knu / barrier_karabiner.lua
Last active April 26, 2024 17:58
Barrier and Karabiner-Elements integration using Hammerspoon
knu = require("knu") -- https://github.com/knu/hs-knu
-- Switch between Karabiner-Elements profiles as Barrier enters a different host
do
-- Configure Barrier (https://github.com/debauchee/barrier) to output log to ~/Library/Logs/barrier.log
local logFile = os.getenv("HOME") .. "/Library/Logs/barrier.log"
local lineNo = 1
local host = nil
local defaultProfile = "Default"
local profileForHost = function (host)