Skip to content

Instantly share code, notes, and snippets.

@piyushsoni
piyushsoni / barrier_karabiner.lua
Created October 2, 2022 15:38 — forked from knu/barrier_karabiner.lua
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 profile"
local profileForHost = function (host)