-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelpers.lua
41 lines (34 loc) · 862 Bytes
/
helpers.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
local M = {}
M.P = function (v)
print(vim.inspect(v))
return v
end
M.Loop = function (tbl)
local result = ""
for _, v in ipairs(tbl) do
result = result ..v.. "\n"
end
return result
end
M.Command_exists = function (cmd)
local handle = io.popen('command -v' .. cmd)
if handle then
local result = handle:read("*a")
return result ~= ""
else
print(cmd, 'unable to rest command')
return nil
end
end
M.hi = function (name)
print(name)
end
M.dmenu = 'echo " " | dmenu -m 0 -fn VictorMono:size=17 -nf cyan -nb black -nf cyan -sb black'
M.check = function (status_code, message)
if status_code == 0 then
os.execute('notify-send -u normal "'..message..'"')
elseif status_code == 1 then
os.execute('notify-send -u critical "'..message'"')
end
end
return M