this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

replace rectangle functionality with hammerspoon

+54 -1
-1
Brewfile
··· 13 13 cask "audacity" 14 14 mas "tailscale", id: 1475387142 15 15 cask "raycast" 16 - cask "rectangle" 17 16 cask "meetingbar" 18 17 cask "google-chrome" 19 18 cask "firefox"
+54
hammerspoon/init.lua
··· 17 17 hs.reload() 18 18 end) 19 19 20 + -- Window management 21 + hs.window.animationDuration = 0 22 + 23 + local function moveWindow(fn) 24 + local win = hs.window.focusedWindow() 25 + if not win then return end 26 + local screen = win:screen():frame() 27 + fn(win, screen) 28 + end 29 + 30 + local windowBindings = { 31 + h = function(w, s) w:setFrame({ x = s.x, y = s.y, w = s.w / 2, h = s.h }) end, 32 + l = function(w, s) w:setFrame({ x = s.x + s.w / 2, y = s.y, w = s.w / 2, h = s.h }) end, 33 + Return = function(w, s) w:setFrame(s) end, 34 + u = function(w, s) w:setFrame({ x = s.x, y = s.y, w = s.w / 2, h = s.h / 2 }) end, 35 + i = function(w, s) w:setFrame({ x = s.x + s.w / 2, y = s.y, w = s.w / 2, h = s.h / 2 }) end, 36 + j = function(w, s) w:setFrame({ x = s.x, y = s.y + s.h / 2, w = s.w / 2, h = s.h / 2 }) end, 37 + k = function(w, s) w:setFrame({ x = s.x + s.w / 2, y = s.y + s.h / 2, w = s.w / 2, h = s.h / 2 }) end, 38 + } 39 + 40 + for key, fn in pairs(windowBindings) do 41 + hs.hotkey.bind({ "ctrl", "alt" }, key, function() moveWindow(fn) end) 42 + end 43 + 44 + -- Cycling window positions (thirds and 2/3rds) 45 + local cycleState = { g = 0, e = 0 } 46 + 47 + -- g: 1/3 width, cycles right → middle → left 48 + hs.hotkey.bind({ "ctrl", "alt" }, "g", function() 49 + local win = hs.window.focusedWindow() 50 + if not win then return end 51 + local s = win:screen():frame() 52 + local positions = { 53 + { x = s.x + s.w * 2/3, y = s.y, w = s.w / 3, h = s.h }, 54 + { x = s.x + s.w / 3, y = s.y, w = s.w / 3, h = s.h }, 55 + { x = s.x, y = s.y, w = s.w / 3, h = s.h }, 56 + } 57 + cycleState.g = (cycleState.g % #positions) + 1 58 + win:setFrame(positions[cycleState.g]) 59 + end) 60 + 61 + -- e: 2/3 width, cycles left → right 62 + hs.hotkey.bind({ "ctrl", "alt" }, "e", function() 63 + local win = hs.window.focusedWindow() 64 + if not win then return end 65 + local s = win:screen():frame() 66 + local positions = { 67 + { x = s.x, y = s.y, w = s.w * 2/3, h = s.h }, 68 + { x = s.x + s.w / 3, y = s.y, w = s.w * 2/3, h = s.h }, 69 + } 70 + cycleState.e = (cycleState.e % #positions) + 1 71 + win:setFrame(positions[cycleState.e]) 72 + end) 73 + 20 74 hs.alert.show("Config loaded")