]> git.rmz.io Git - dotfiles.git/blobdiff - awesome/utils.lua
[WIP] Push all of the ultrahaptics changes!
[dotfiles.git] / awesome / utils.lua
index 357d8b69286c27d5ec092fc59cac20a4fe276b04..de240dedc9d471a7951382733a14d816bcdb3f8d 100644 (file)
@@ -9,6 +9,10 @@ utils.globalkeys = { }
 local host = io.popen("hostname")
 utils.host = host:read("*l")
 
 local host = io.popen("hostname")
 utils.host = host:read("*l")
 
+function utils.is_dir(path)
+    return os.execute(('[ -d "%s" ]'):format(path))
+end
+
 function utils.run_or_kill(prg, cprop, screen)
     if not prg then
         do return nil end
 function utils.run_or_kill(prg, cprop, screen)
     if not prg then
         do return nil end
@@ -67,7 +71,7 @@ function utils.get_default_sink()
     local f = io.popen('ponymix defaults --short')
     line = f:read('*l')
     f:close()
     local f = io.popen('ponymix defaults --short')
     line = f:read('*l')
     f:close()
-    return string.match(line, "^sink%s*%d*%s*(.-)%s")
+    return string.match(line, "^sink%s*%d*%s*(.-)%s") or ""
 end
 
 function utils.joinTables(t1, t2)
 end
 
 function utils.joinTables(t1, t2)