-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenuItem.lua
53 lines (49 loc) · 1.18 KB
/
menuItem.lua
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
local function menuItem(wp)
local menubar = hs.menubar.new()
local function updateMenu()
if menubar then
menubar:setTitle("")
local image = hs.image.imageFromName("NSStatusAvailable")
menubar:setIcon(image)
menubar:setMenu({
{
title = "Binary Space Partitioning",
fn = function()
wp.commands.windowLayout.layoutTiledBSP()
updateMenu()
end,
},
{
title = "Main and Stack",
fn = function()
wp.commands.windowLayout.layoutMainAndStack()
updateMenu()
end,
},
{
title = "Threes",
fn = function()
wp.commands.windowLayout.layoutThrees()
updateMenu()
end,
},
{
title = "Full Screen",
fn = function()
wp.commands.windowLayout.layoutFullScreen()
updateMenu()
end,
},
{
title = "Cascading",
fn = function()
wp.commands.windowLayout.layoutCascading()
updateMenu()
end,
},
})
end
end
updateMenu()
end
return menuItem