]> git.rmz.io Git - dotfiles.git/blob - awesome/utils.lua
add host variable to utils
[dotfiles.git] / awesome / utils.lua
1 local utils = { }
2
3
4 local host = io.popen("hostname")
5 utils.host = host:read("*l")
6
7 function utils.run_or_kill(command)
8 -- Check throught the clients if the class match the command
9 local lower_command=string.lower(command)
10 for k, c in pairs(client.get()) do
11 local class=string.lower(c.class)
12 if string.match(class, lower_command) then
13 for i, v in ipairs(c:tags()) do
14 c:kill()
15 return
16 end
17 end
18 end
19 awful.util.spawn(command)
20 end
21
22 return utils