-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.lua
More file actions
45 lines (30 loc) · 973 Bytes
/
functions.lua
File metadata and controls
45 lines (30 loc) · 973 Bytes
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
function listApps()
print('-- Listing Running Apps --');
--hs.fnutils.each(hs.application.runningApplications(), function(app) print(app:bundleID(), app:title()) end)
local screenCount = tablelength(hs.screen.allScreens());
local printedApp = {};
for i,app in pairs(hs.application.runningApplications()) do
print(app:pid())
end
print('------------');
end
function tablelength(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count
end
function merge(firstTable, secondTable)
local newTable = hs.fnutils.copy(firstTable);
return hs.fnutils.concat(newTable, secondTable);
end
function scaleWindow(window, amount)
local frame = window:frame();
frame.x = frame.x - amount;
frame.y = frame.y - amount;
frame.w = frame.w + amount*2;
frame.h = frame.h + amount*2;
window:setFrame(frame);
end
function screenCount()
return tablelength(hs.screen.allScreens())
end