Hi,

On 14.06.2012 05:45, Evan Driscoll wrote:
> For various reasons I'm moving back to Awesome after a couple years of
> Xmonad. Unfortunately, having used both models for a while, I rather
> prefer the Xmonad approach of sharing the tagset between monitors. (It's
> rather more flexible at the cost of increasing the number of keys you
> need. Fortunately, there are plenty of those, and even more to come when
> I'm done with the main thing that's getting me to switch. :-)) So I'm
> trying to emulate it.
[...]
> I put my rc.lua at http://pastebin.com/VUmkWHpb. I think there are only
> three changes relative to the stock rc.lua that comes packaged with
> Ubuntu (Awesome 3.4.11):
> 
>  - Changing the tag names from 1 through 9 to 1-1 through 1-9 and 2-1
>    through 2-9 (lines 78-86); I think this shouldn't matter but helps
>    figuring out what's going on
> 
>  - The move_clients_from_other_screens() function (line 298). This does
>    the moving things around. In the example of the user changing to A1
>    (moving clients from B1 to A1), to_screen=A and tag_number=1. (Of
>    course, to_screen is actually a number.)
> 
>  - The call to move_clients_from_other_screens() on line 325, from the
>    handler of mod-# presses.
> 
> 
> If you actually read all that, thank you... and any idea of what's going
> on? :-)

Uhm, works fine here. I didn't actually try your config, but instead I copied
over your config. Then I added the call to move_clients_from_other_screens() to
the wrong keybinding (whoops!) and thus added some extra diagnostics (how can
you live with print()? Use naughty.notify()!). After noticing my error,
everything worked fine for me.

Diff to the default config is attached.

I tested this with git/master, but I can't see why it wouldn't work with awesome
3.4.11.

I assume you didn't disable Xinerama? (= Can you make clients floating and move
them to the other screen "by hand"?)

Uli
-- 
- Captain, I think I should tell you I've never
  actually landed a starship before.
- That's all right, Lieutenant, neither have I.
diff --git a/awesomerc.lua.in b/awesomerc.lua.in
index db1f074..3c31e16 100644
--- a/awesomerc.lua.in
+++ b/awesomerc.lua.in
@@ -280,6 +280,29 @@ clientkeys = awful.util.table.join(
         end)
 )
 
+function move_clients_from_other_screens(tags, to_screen, tag_number)
+       local to_tag = tags[to_screen][tag_number]
+       -- From all the other versions of this tag_number...
+       naughty.notify({text = to_screen .. " " .. tag_number})
+       for from_screen = 1, screen.count() do
+               if from_screen ~= to_screen then
+                       -- ...move all clients
+                       local source_tag = tags[from_screen][tag_number]
+                       print("moving clients from " .. source_tag.name .. " to 
" .. to_tag.name)
+                       naughty.notify({text="moving clients from " .. 
source_tag.name .. " to " .. to_tag.name})
+                       if #source_tag:clients() > 0 then
+                               for _ , c in ipairs(source_tag:clients()) do
+                                       print("   actually moving a client: " 
.. c.name)
+                                       naughty.notify({text="   actually 
moving a client: " .. c.name})
+                                       c.screen = to_screen
+                                       awful.client.movetotag(to_tag, c)
+                                       --awful.client.movetoscreen(c)
+                               end
+                       end
+               end
+       end
+end
+
 -- Compute the maximum number of digit we need, limited to 9
 keynumber = 0
 for s = 1, screen.count() do
@@ -296,6 +319,7 @@ for i = 1, keynumber do
                         local screen = mouse.screen
                         if tags[screen][i] then
                             awful.tag.viewonly(tags[screen][i])
+                           move_clients_from_other_screens(tags, screen, i)
                         end
                   end),
         awful.key({ modkey, "Control" }, "#" .. i + 9,

Reply via email to