mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-22 13:25:38 +00:00
clean up hammerspoon on m3 w display
for some reason, i need to multiply x to line up half-max frames
This commit is contained in:
parent
1833bfddfb
commit
5aea58df79
@ -8,10 +8,10 @@ obj.name = "Launcher"
|
||||
obj.version = "0.1"
|
||||
obj.license = "MIT - https://opensource.org/licenses/MIT"
|
||||
|
||||
local width = hs.screen.mainScreen():fullFrame().w
|
||||
local screen = hs.screen.primaryScreen()
|
||||
local switcherWidth = 500
|
||||
obj.canvas = hs.canvas.new({
|
||||
x = width / 2 - switcherWidth / 2,
|
||||
x = (screen:fullFrame().x + screen:fullFrame().w) / 2 - switcherWidth / 2,
|
||||
y = 1,
|
||||
h = 3,
|
||||
w = switcherWidth,
|
||||
|
@ -56,7 +56,7 @@ function obj:init()
|
||||
local frame = win:frame()
|
||||
-- maximize if possible
|
||||
local max = win:screen():fullFrame()
|
||||
frame.x = max.w / 2
|
||||
frame.x = (max.x * 2 + max.w) / 2
|
||||
frame.y = max.y
|
||||
frame.w = max.w / 2
|
||||
frame.h = max.h
|
||||
|
@ -51,6 +51,7 @@ local function worklayout()
|
||||
local laptop = {
|
||||
{ "Firefox", nil, LAPTOP_MONITOR, u(0, 0, 1, 1), nil, nil, visible = true },
|
||||
{ "Obsidian", nil, LAPTOP_MONITOR, u(0, 0, 1, 1), nil, nil, visible = true },
|
||||
{ "Calendar", nil, LAPTOP_MONITOR, u(0, 0, 1, 1), nil, nil, visible = true },
|
||||
}
|
||||
local layout = concat(left, right, laptop)
|
||||
hs.layout.apply(layout)
|
||||
|
Loading…
Reference in New Issue
Block a user