X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/fe37fd5a0ed2d23f478a09a92959dd4a9ba5a733..4e2799a8b1b2d11ba19d0052d2fe8d145a7da312:/awesome/utils.lua diff --git a/awesome/utils.lua b/awesome/utils.lua index c7a5492..e97aa22 100644 --- a/awesome/utils.lua +++ b/awesome/utils.lua @@ -1,14 +1,20 @@ local utils = { } +local host = io.popen("hostname") +utils.host = host:read("*l") + function utils.run_or_kill(command) -- Check throught the clients if the class match the command local lower_command=string.lower(command) for k, c in pairs(client.get()) do - local class=string.lower(c.class) - if string.match(class, lower_command) then - for i, v in ipairs(c:tags()) do - c:kill() - return + -- apparently some steam games don't have a client class + if c.class ~= nil then + local class=string.lower(c.class) + if string.match(class, lower_command) then + for i, v in ipairs(c:tags()) do + c:kill() + return + end end end end