This commit is contained in:
James Reed 2020-12-20 17:11:35 -07:00
parent d2889af874
commit 832ccc693e
No known key found for this signature in database
GPG Key ID: 0BE2BD33C5E8125E
4 changed files with 28 additions and 12 deletions

View File

@ -37,7 +37,9 @@ end
awful.rules.add_rule_source("launch", awful.rules.add_rule_source("launch",
function (c, props, callbacks) function (c, props, callbacks)
local data = get_data(c) local data = get_data(c)
if not data then return end if not data then
return
end
data.timer:stop() data.timer:stop()
@ -64,7 +66,9 @@ launch.client = {}
local function get_ids() local function get_ids()
local ids = {} local ids = {}
for _, c in ipairs(client.get()) do for _, c in ipairs(client.get()) do
if c.single_instance_id then ids[c.single_instance_id] = c end if c.single_instance_id then
ids[c.single_instance_id] = c
end
end end
return ids return ids
end end
@ -206,7 +210,9 @@ function launch.spawn.single_instance(cmd, args)
else else
c = launch.client.by_cmdline(cmd, args.filter) c = launch.client.by_cmdline(cmd, args.filter)
end end
if not c then return spawn(cmd, args) end if not c then
return spawn(cmd, args)
end
return args.id return args.id
end end
@ -245,7 +251,9 @@ function launch.spawn.raise_or_spawn(cmd, args)
if args.raise_callback then if args.raise_callback then
local cb = args.callback local cb = args.callback
args.callback = function (c) args.callback = function (c)
if cb then cb(c) end if cb then
cb(c)
end
args.raise_callback(c) args.raise_callback(c)
end end
end end
@ -272,7 +280,9 @@ function launch.spawn.here(tag_func)
end end
local a = { local a = {
filter = function (c) return c:isvisible() end, filter = function (c)
return c:isvisible()
end,
props = {tag = tag}, props = {tag = tag},
} }
gears.table.crush(a, args or {}) gears.table.crush(a, args or {})

View File

@ -56,7 +56,9 @@ local function spawn(cmd, args)
end end
end) end)
end) end)
if cb then cb(c) end if cb then
cb(c)
end
panel.toggle_func(c, true) panel.toggle_func(c, true)
end end
launch.spawn.single_instance(cmd, args) launch.spawn.single_instance(cmd, args)

View File

@ -35,7 +35,9 @@ local function props_visible(s, p)
end end
if p.tags then if p.tags then
for _, t in ipairs(p.tags) do for _, t in ipairs(p.tags) do
if selected(t) then return true end if selected(t) then
return true
end
end end
end end
end end

View File

@ -43,7 +43,9 @@ local function handle_args(tag, args)
end end
if args.replace and not tag.volatile then if args.replace and not tag.volatile then
for _, c in ipairs(tag:clients()) do c:kill() end for _, c in ipairs(tag:clients()) do
c:kill()
end
end end
if args.clients then if args.clients then