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