X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/172cfbb4b15794f9dd12a4531e6ba6b8f0edbb2a..800d8089ce276ae1b2a3f9875a370b7e00a763db:/awesome/utils.lua diff --git a/awesome/utils.lua b/awesome/utils.lua index 070cb3e..4042241 100644 --- a/awesome/utils.lua +++ b/awesome/utils.lua @@ -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 @@ -79,11 +90,11 @@ function utils.joinTables(t1, t2) end function utils.rules.append(rules) - awful.rules.rules = awful.util.table.join(awful.rules.rules, rules) + awful.rules.rules = gears.table.join(awful.rules.rules, rules) end function utils.globalkeys.append(keys) - globalkeys = awful.util.table.join(globalkeys, keys) + globalkeys = gears.table.join(globalkeys, keys) end function utils.has_battery()