Hi,

   ( my first post to the awesome mailing list )

   Firstly, a huge thanks to Julien and the rest of the crew
   for such a wonderfully flexible and configurable window manager,
   Yes ... it ... is ... awesome !!!

   However, before everyone gets too happy and contented, I found
   some really strange behaviour.  I wrote a tiny rc.lua file
   ( included in full at the end of this message ), which simply
   creates two tags as follows:

      tag1        = tag( "1" )
      tag1.screen = 1

      tag2        = tag( "2" )
      tag2.screen = 1

   then sets up a table 'othertag':

      othertag         = { }
      othertag[ tag1 ] = tag2
      othertag[ tag2 ] = tag1

   and finally defines a pair of global keys:

      key( { }, "a", function ( )
                        local thistag = awful.tag.selected( )
                        if thistag == tag1 then
                           awful.tag.viewonly( othertag[ tag1 ] )
                        elseif thistag == tag2 then
                           awful.tag.viewonly( othertag[ tag2 ] )
                           end
                        end )

      key( { }, "b", function ( )
                        local thistag = awful.tag.selected( )
                        awful.tag.viewonly( othertag[ thistag ] )
                        end )

   So keys 'a' and 'b' should both simply flip between tags 1 and 2.

   Key 'a' works fine, just as expected.

   Key 'b' fails, however, with  othertag[ thistag ] = nil .

   Looking at the Lua code, it's hard to see how there could be
   any difference whatsoever between the actions of the two keys.

   Or am I doing something really really silly here?

Joseph

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Joseph Manning / Computer Science / UCC Cork Ireland / [email protected]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

THE FULL rc.lua FILE :

-----------------------------------------------------------------
--  This tiny  awesomerc.lua  file  simply  creates two tags.  --
--  Keys  'a'  and  'b'  should flip  between these two tags.  --
--  Key 'a' works just as expected,  but key 'b' fails,  with  --
--     othertag[ thistag ] = nil                               --
-----------------------------------------------------------------
--  awesome v3.2.1 / Lua 5.1.4 / Debian 5.0 / Acer Aspire One  --
-----------------------------------------------------------------
--      Joseph Manning : [email protected] : 2009-May-16       --
-----------------------------------------------------------------

---------------------------------------------------------------------- libraries

require( "awful"     )
require( "beautiful" )

---------------------------------------------------------------------- theme

beautiful.init( "/usr/share/awesome/themes/default/theme" )

---------------------------------------------------------------------- tags

tag1        = tag( "1" )
tag1.screen = 1

tag2        = tag( "2" )
tag2.screen = 1

othertag         = { }
othertag[ tag1 ] = tag2
othertag[ tag2 ] = tag1

tag1.selected = true

---------------------------------------------------------------------- topbar

taglist = awful.widget.taglist.new( 1, awful.widget.taglist.label.all )

topbar         = wibox{ }
topbar.widgets = { taglist }
topbar.screen  = 1

---------------------------------------------------------------------- keys

rootkeys =
{
   key( { }, "a", function ( )
                     local thistag = awful.tag.selected( )
                     if thistag == tag1 then
                        awful.tag.viewonly( othertag[ tag1 ] )
                     elseif thistag == tag2 then
                        awful.tag.viewonly( othertag[ tag2 ] )
                        end
                     end ),

   key( { }, "b", function ( )
                     local thistag = awful.tag.selected( )
                     awful.tag.viewonly( othertag[ thistag ] )
                     end ),

   key( { }, "q", awesome.quit )
}

root.keys( rootkeys )

--------------------------------------------------------------------------------

-- 
To unsubscribe, send mail to [email protected].

Reply via email to