Last active
August 29, 2015 14:17
-
-
Save crater2150/1fbc5cbb3ad40e1f7dba to your computer and use it in GitHub Desktop.
Trying to move different firefox profiles to different tags in awesomewm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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 | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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