]> git.rmz.io Git - dotfiles.git/commitdiff
fixup! awesome: add function to check if host has battery
authorSamir Benmendil <samir.benmendil@ultrahaptics.com>
Mon, 24 Oct 2016 07:48:49 +0000 (08:48 +0100)
committerSamir Benmendil <samir.benmendil@ultrahaptics.com>
Mon, 24 Oct 2016 07:48:49 +0000 (08:48 +0100)
awesome/utils.lua

index 357d8b69286c27d5ec092fc59cac20a4fe276b04..0f12be1aab2c6ba50fd5ae8d5efb339c7449c9b0 100644 (file)
@@ -9,6 +9,10 @@ utils.globalkeys = { }
 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