]> git.rmz.io Git - dotfiles.git/blobdiff - awesome/utils.lua
fix kmix spawning when steam games are running
[dotfiles.git] / awesome / utils.lua
index f534770af6f48aacdd5810a0318d89bc9201e6d1..e97aa22f96da93a41e3ec4802353e9dd3f5bf5ab 100644 (file)
@@ -1,6 +1,5 @@
 local utils = { }
 
-
 local host = io.popen("hostname")
 utils.host = host:read("*l")
 
@@ -8,11 +7,14 @@ 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