From b56f5b875325709df60265b8cb2f9834ea77133b Mon Sep 17 00:00:00 2001 From: Corey Smith Date: Tue, 22 Jul 2025 02:38:31 -0700 Subject: [PATCH] Update --- dot_hammerspoon/init.lua | 24 ++++++++++++++++++++++++ dot_hammerspoon/symlink_init.lua | 1 - 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 dot_hammerspoon/init.lua delete mode 100644 dot_hammerspoon/symlink_init.lua diff --git a/dot_hammerspoon/init.lua b/dot_hammerspoon/init.lua new file mode 100644 index 0000000..6722d4b --- /dev/null +++ b/dot_hammerspoon/init.lua @@ -0,0 +1,24 @@ +-- Function to simulate key presses +local function pressFn(mods, key) + if key == nil then + key = mods + mods = {} + end + + return function() hs.eventtap.keyStroke(mods, key, 1000) end +end + +-- Function to remap keys +local function remap(mods, key, pressFn) + hs.hotkey.bind(mods, key, pressFn, nil, pressFn) +end + +-- Define Caps Lock as the Hyperkey +local hyper = {'ctrl', 'alt', 'cmd'} + +-- Remap HJKL to arrow keys using Caps Lock as a Hyperkey +remap(hyper, 'h', pressFn({}, 'left')) -- Move left +remap(hyper, 'j', pressFn({}, 'down')) -- Move down +remap(hyper, 'k', pressFn({}, 'up')) -- Move up +remap(hyper, 'l', pressFn({}, 'right')) -- Move right + diff --git a/dot_hammerspoon/symlink_init.lua b/dot_hammerspoon/symlink_init.lua deleted file mode 100644 index eb42062..0000000 --- a/dot_hammerspoon/symlink_init.lua +++ /dev/null @@ -1 +0,0 @@ -../.dotfiles/hammerspoon/.hammerspoon/init.lua