]> git.rmz.io Git - dotfiles.git/blobdiff - awesome/utils.lua
awesome: use TERMINAL env as much as possible
[dotfiles.git] / awesome / utils.lua
index b8dd97fd122ad2347193fccc53677b930fbe5e94..40422416fa798df90f2ee3d4f3b5dd28265fa49e 100644 (file)
@@ -13,6 +13,17 @@ function utils.is_dir(path)
     return os.execute(('[ -d "%s" ]'):format(path))
 end
 
+function utils.spawn_terminal(prg, cprop, cb)
+    local join = require("gears.table").join
+    local term_cmd = {terminal}
+    if cprop and cprop.instance then
+        if terminal:match("rxvt") then
+            term_cmd = join(term_cmd, {"-name", cprop.instance})
+        end
+    end
+    awful.spawn(join(term_cmd, {"-e", prg}), cprop, cb)
+end
+
 function utils.run_or_kill(prg, cprop, screen)
     if not prg then
         do return nil end