At Wed, 18 Feb 2009 11:33:23 -0800
Josh Dukes wrote:

> I switched from xmonad to awesome a few months ago, and I'm pretty
> happy with it. The one big thing I miss from xmonad is that tags were
> independant of screens, so a tag could be on any screen. I've found
> ways to work around this, but I do really miss the flexibility of being
> able to put anything anywhere. Is it possible to do this with awesome?
> I played around with the config and I thought I could do it, but
> something wasn't right. Is there a plugin for this or something?
> 

If you mean moving a tag from one screen to another, this function should do it:

function movescreen(scr_target)
    local scr_source = mouse.screen
    if #(screen[scr_source]:tags()) <= 1 then return end
    local t = awful.tag.selected(scr_source)
    -- first, move all clients on the tag to the target screen and set the tag 
as their only tag
    local clients = t:clients()
    for i = 1, #clients do
        clients[i].screen = scr_target
        clients[i]:tags({ t })
    end
    t:clients(clients)

    -- then, remove the tag from the source screens taglist
    local index = tag2index(scr_source, t)
    local tags = screen[scr_source]:tags()
    if t.selected then
        if index == #tags then
            awful.tag.viewidx(-1, scr)
        else
            awful.tag.viewidx(1, scr)
        end
    end
    table.remove(tags, index)
    screen[scr_source]:tags(tags)

    -- insert the tag into target screens tag list
    t.screen = scr_target
    tags = screen[scr_target]:tags()
    table.insert(tags, t)

    awful.hooks.user.call("arrange", scr_target)
    awful.tag.viewonly(tags[#tags])
end

It moves the currently selected tag on the mouse cursors screen to the screen
indicated by the functions parameter. All clients on the selected tag are moved
to the target screen.

-- 
GCS/IT/M d- s+:- a--- C++ UL+++ US UB++ P+++ L+++ E--- W+ N+ o--
K- w--- O M-- V PS+ PE- Y+ PGP+++ t+ 5 X+ R tv+ b++ DI+++ D+++ G+
e- h! r y+

    Gregor Best

Attachment: signature.asc
Description: PGP signature

Reply via email to