-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 27/08/12 00:16, Manuel Kasser wrote: > Hi, I wanted to write a function for awesome, so that I'm able to shove a > selected client to > the previous or next tag with a certain keybind. I can, even by default, > already do this by > sending a client to a certain tag, but I want do add the functionality for > doing this for the > "next tag", no matter what tag is active. My problem is, I want the tag after > the last tag to > be the first tag, like a circle of all tags, but I think I need the total > number of tags on my > screen to do so. I could do that hardcoded, but to avoid inconsistency I > would prefer to get > the number of tags after they've been created, so I don't have to change an > extra variable when > changing the number of tags. But I wasn't able to find a function which gives > me the number of > tags on a screen (or I just misunderstood the documentation). > > I thougt about getting the actual tag number and then putting the client to > the tag > (number%totaltagnumber + 1) or (number%totaltagnumber - 1), depending on what > direction is > selected. If this idea means a whole amount of unnecessary, maybe inefficient > code, I'm glad if > you would tell me, I'm new to awesome (but already fascinated) and not very > experienced.
I can't help you directly wioth your question, but I have (from https://github.com/ierton/awesomerc-ierton) a function which is doing exctly that: moving a client to the next tag, with cycling - check out the keybinding for modkey F2: awful.key({ modkey }, "F2", function (c) local tag = myrc.tagman.getn(1) awful.client.movetotag(tag, c) awful.tag.viewonly(tag) c:raise() end), and the corresponding functions. Hope this helps, Rainer > > Thanks in advance, Manuel > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlA7IUIACgkQoYgNqgF2egqpQwCbB3y8nCfu8+hjuJteH81sTlWa GV8AnAjlJYToHITTeJBISy9bjKPRALF1 =v8GM -----END PGP SIGNATURE----- -- To unsubscribe, send mail to [email protected].
