Skip to content

Instantly share code, notes, and snippets.

@crater2150
Last active August 29, 2015 14:17
Show Gist options
  • Save crater2150/1fbc5cbb3ad40e1f7dba to your computer and use it in GitHub Desktop.
Save crater2150/1fbc5cbb3ad40e1f7dba to your computer and use it in GitHub Desktop.
Trying to move different firefox profiles to different tags in awesomewm
{
rule = { class = "Firefox", instance = "Navigator" },
properties = {
tag = tags[rule_screen][2],
floating = false, minimized = false
},
callback = function(client)
client:connect_signal("property::name", function (c)
if string.find(c.name, "Pentadactyl") and not c.moved then
awful.client.movetotag(tags[rule_screen][3], c)
awful.client.setslave(c)
c.moved = true
end
end)
end
},
{
rule = { class = "Firefox", instance = "Navigator" },
properties = {
tag = tags[rule_screen][2],
floating = false, minimized = false
},
callback = function(client)
-- Ugly hack:
-- create a function and save it to an object,
-- which is used in the function, so that it can
-- reference itself
closure_data = {}
on_namechange = function(c)
if string.find(c.name, "Pentadactyl") then
awful.client.movetotag(tags[rule_screen][3], c)
awful.client.setslave(c)
client:disconnect_signal("property::name", closure_data.func)
end
end
closure_data.func = on_namechange
client:connect_signal("property::name", on_namechange)
end
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment