Awesome – move applications automatically to the tab they’re spawned on

I can move to an empty tag, launch openoffice, go back to browser while it’s loading, and it’ll load on the tab I launched it on. Magic!

Add the following somewhere (pretty much anywhere, but after the inclusion of awful, and before the hook_manage function)

spawn = awful.util.spawn
move_to = {}
awful.util.spawn = function (spawnwhat, screen)
    screen = screen or mouse.screen
    local current_tag = awful.tag.selected(screen)
    move_to[#move_to+1] = {tag=current_tag, screen=screen}
    spawn(spawnwhat, screen)
end

Now add to hook_manage

if #move_to then
   c.screen = move_to[#move_to].screen
   awful.client.movetotag(move_to[#move_to].tag, c)
   move_to.remove()
end
Advertisements
Awesome – move applications automatically to the tab they’re spawned on

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s