-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathborder.lua
More file actions
32 lines (26 loc) · 1.01 KB
/
border.lua
File metadata and controls
32 lines (26 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
border = nil
function drawBorder()
if border then
border:delete()
end
local win = hs.window.focusedWindow()
if win == nil then return end
local f = win:frame()
local fx = f.x - 3
local fy = f.y - 3
local fw = f.w + 6
local fh = f.h + 6
border = hs.drawing.rectangle(hs.geometry.rect(fx, fy, fw, fh))
border:setStrokeWidth(8)
border:setFillColor({["red"]=0,["blue"]=0.70,["green"]=0.55,["alpha"]=0.75})
border:setStrokeColor({["red"]=0,["blue"]=0.70,["green"]=0.55,["alpha"]=0.75})
border:setRoundedRectRadii(5.0, 5.0)
border:setStroke(true):setFill(false)
border:sendToBack():show()
end
drawBorder()
windows = hs.window.filter.new(nil)
windows:subscribe(hs.window.filter.windowCreated, function () drawBorder() end)
windows:subscribe(hs.window.filter.windowFocused, function () drawBorder() end)
windows:subscribe(hs.window.filter.windowMoved, function () drawBorder() end)
windows:subscribe(hs.window.filter.windowUnfocused, function () drawBorder() end)