Skip to content

Instantly share code, notes, and snippets.

@josephsdavid
Created May 4, 2022 21:48
Show Gist options
  • Save josephsdavid/a517cdc39dd4e9214a7810f0dd0abcc1 to your computer and use it in GitHub Desktop.
Save josephsdavid/a517cdc39dd4e9214a7810f0dd0abcc1 to your computer and use it in GitHub Desktop.
hammerspoon config
PaperWM = hs.loadSpoon("PaperWM")
SpoonInstall = hs.loadSpoon("SpoonInstall")
local function make_mod(mod)
local function ret(s)
return {mod, s}
end
return ret
end
local alt = make_mod({"alt"})
local alt_s = make_mod({"alt", "shift"})
local alt_cs = make_mod({"alt", "shift", "ctrl"})
local alt_c = make_mod({"alt", "ctrl"})
PaperWM:bindHotkeys({
focus_left = alt("h"),
focus_right = alt("l"),
focus_down = alt("j"),
focus_up = alt("k"),
swap_left = alt_s("h"),
swap_right = alt_s("l"),
swap_down = alt_s("j"),
swap_up = alt_s("k"),
center_window = alt_c("u"),
full_width = alt("f"),
cycle_width = alt_s("space"),
cycle_height = alt_c("space"),
slurp_in = alt("i"),
barf_out = alt("o"),
switch_space_1 = alt('1'),
switch_space_2 = alt('2'),
switch_space_3 = alt('3'),
switch_space_4 = alt('4'),
switch_space_5 = alt('5'),
switch_space_6 = alt('6'),
switch_space_7 = alt('7'),
switch_space_8 = alt('8'),
switch_space_9 = alt('9'),
move_window_1 = alt_s('1'),
move_window_2 = alt_s('2'),
move_window_3 = alt_s('3'),
move_window_4 = alt_s('4'),
move_window_5 = alt_s('5'),
move_window_6 = alt_s('6'),
move_window_7 = alt_s('7'),
move_window_8 = alt_s('8'),
move_window_9 = alt_s('9'),
})
PaperWM:start()
SpoonInstall:andUse("AppLauncher", {
hotkeys = {
d = "Discord",
v = "Google Chrome",
s = "Slack",
t = "Alacritty",
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment