Elv13 / tyrannical

Dynamic tagging configuration system for awesomeWM
211 stars 33 forks source link

Match client when send to screen #56

Open getzze opened 9 years ago

getzze commented 9 years ago

I use two screens, and I have to switch clients from one screen to the other. However, when the client is sent to the other screen, it goes to the opened tag there. I would like the client to go tha tag matched by tyrannical. This can be done by making the match_client function of tyrannical part of the API. In init.lua:

module.match_client = match_client

Then for my shortcut (Win+F5 in my case) I set:

awful.key({ modkey,           }, "F5",     function (c) c.maximized=false awful.client.movetoscreen(c) tyrannical.match_client(c) c.maximized=true end,  "Move to other screen")
slavaGanzin commented 9 years ago

+1

igwan commented 8 years ago

I can't get this to work, is anything more needed in awesome/tyrannical config ?

Wonskcalb commented 8 years ago

+1 for a native integration of this into Tyrannical

Elv13 commented 7 years ago

Update on this.The next branch for the soon to be released Awesome 4.0 has an "if" to keep the old behavior of letting clients be dragged between screen without causing an explosion. If some of you are willing to have the feature proposed here, add a new variable to skip that if, remove the client old tags (c:tags{}) and it should work.

local function match_client(c, forced_tags, hints)
    -- Don't prevent tags from being drag and dropped between screens
    if hints and hints.reason == "screen" then -- <=== THIS
        c:tags {c.screen.selected_tag}
        return true
    end

I added an API in Awesome itself to support this, but I forgot to tell you. I don't have time to test this. Releasing Awesome4 and all my modules for it is already more work than I have time for.