make switcher visuals adaptive

This commit is contained in:
Noah Masur 2022-04-21 17:26:34 -04:00
parent 2e737fd85c
commit eb99ec48f7

View File

@ -10,7 +10,14 @@ obj.license = "MIT - https://opensource.org/licenses/MIT"
function drawSwitcher()
-- Drawing
canv = hs.canvas.new({ x = 850, y = 1, h = 3, w = 120 })
width = hs.screen.mainScreen():fullFrame().w
switcherWidth = 500
canv = hs.canvas.new({
x = width / 2 - switcherWidth / 2,
y = 1,
h = 3,
w = switcherWidth,
})
canv[#canv + 1] = {
action = "build",
type = "rectangle",
@ -66,6 +73,9 @@ function obj:init()
self.launcher:bind("", "F", function()
self:switch("Firefox.app")
end)
self.launcher:bind("", "H", function()
self:switch("Hammerspoon.app")
end)
self.launcher:bind("", "G", function()
self:switch("Mimestream.app")
end)