简体   繁体   中英

awesome WM how to change tag of screen

I would like to change a tag assign to one screen and move it to the other screen with the clients inside it. following the api https://awesome.naquadah.org/doc/api/modules/awful.tag.html I see that I can move a tag, but it seems that it has to stay in the same screen... The only wait I see how to do it:

  1. create a new tag with the same name in the other screen
  2. move the clients in that new tag
  3. delete the old tag in the current monitor
  4. switch focus ...
    but this seems like a horrible solution... any workaround?

Starting from awesome v3.5, the API you linked to has been extended with the awful.tag.setscreen() function, which can be used to move a tag with all clients to another screen.

The wiki lists modules which can be used to easily share and move tags between all screens. If you would rather implement your own function, I would suggest looking at the sharedtags.movetag() function, where I've solved or worked around a few problems with moving tags to another screen.

https://awesome.naquadah.org/doc/api/modules/awful.client.html#movetoscreen will move a window to screen. The next step would be is to get all clients in specific tag. This you can do like that https://awesome.naquadah.org/doc/api/modules/tag.html#clients .

So, to sum up, it should look like this:

function move_tag_to_screen(tag,screen) 
  local clients = tag.clients()
  for client in clients do 
    client.movetoscreen(screen)
  end
end

Handn't tied it though.

Deleting and creating tags should be trivial at this point.

This is how to move client to a different tag https://awesome.naquadah.org/doc/api/modules/awful.client.html#movetotag

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM