Created
April 18, 2021 11:27
-
-
Save jbfriedrich/6021f6aef91275eb5db2a1fcf55d581f to your computer and use it in GitHub Desktop.
Revisions
-
jbfriedrich created this gist
Apr 18, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,93 @@ -------------------------------------------------------------------------------- -- Hammerspoon config to replace parts of Mosaic -- -- References: -- * https://www.hammerspoon.org/go/ -- * https://www.hammerspoon.org/docs/index.html -------------------------------------------------------------------------------- hs.hotkey.bind({"cmd", "alt", "ctrl"}, "n", function() local win = hs.window.focusedWindow() local f = win:frame() local screen = win:screen() local max = screen:frame() f.w = 1280 f.h = 800 f.x = ((max.w - f.w) / 2) + max.x f.y = ((max.h - f.h) / 2) + max.y win:setFrame(f) end) hs.hotkey.bind({"cmd", "alt", "ctrl"}, "p", function() local win = hs.window.focusedWindow() local f = win:frame() local screen = win:screen() local max = screen:frame() f.w = 1920 f.h = 1080 f.x = ((max.w - f.w) / 2) + max.x f.y = ((max.h - f.h) / 2) + max.y win:setFrame(f) end) hs.hotkey.bind({"cmd", "alt", "ctrl"}, "b", function() local win = hs.window.focusedWindow() local f = win:frame() local screen = win:screen() local max = screen:frame() f.w = 1024 f.h = 600 f.x = ((max.w - f.w) / 2) + max.x f.y = ((max.h - f.h) / 2) + max.y win:setFrame(f) end) hs.hotkey.bind({"cmd", "alt", "ctrl"}, "f", function() local win = hs.window.focusedWindow() local f = win:frame() local screen = win:screen() local max = screen:frame() f.w = 1050 f.h = 800 f.x = ((max.w - f.w) / 2) + max.x f.y = ((max.h - f.h) / 2) + max.y win:setFrame(f) end) hs.hotkey.bind({"cmd", "alt", "ctrl"}, "]", function() local win = hs.window.focusedWindow() local f = win:frame() local screen = win:screen() local max = screen:frame() f.w = 570 f.h = 900 f.x = ((max.w - f.w) / 2) + max.x f.y = ((max.h - f.h) / 2) + max.y win:setFrame(f) end) hs.hotkey.bind({"cmd", "alt", "ctrl"}, "[", function() local win = hs.window.focusedWindow() local f = win:frame() local screen = win:screen() local max = screen:frame() f.w = 570 f.h = 478 f.x = ((max.w - f.w) / 2) + max.x f.y = ((max.h - f.h) / 2) + max.y win:setFrame(f) end) hs.hotkey.bind({"cmd", "alt", "ctrl"}, "\\", function() local win = hs.window.focusedWindow() local f = win:frame() local screen = win:screen() local max = screen:frame() local fullscreen = screen:fullFrame() f.w = 663 f.h = (max.h * 0.85) f.x = max.w - (f.w * 1.025) f.y = ((max.h - f.h) / 2) + max.y win:setFrame(f) end)