Hi,

On 17.05.2014 21:11, Peter Schroeder wrote:
> I am attempting to modify the taskbar to function like screen/tmux. I have
> figured out how to modify the text of the taskbar buttons to include a
> number to the left of it, but I can't figure out what variable or function
> to use to get the order of the windows to get the number. Am I looking for
> something that isn't there? Any help would be appreciated.

There is no generic function currently to get this information. This is mostly
because the tasklist gets a filter function and you can thus influence which
clients are included and which aren't. The order is always the order in which
e.g. client.get() or awful.client.visible() returns the clients.

The default config uses the currenttags filter:

  mytasklist[s] = awful.widget.tasklist(s,
awful.widget.tasklist.filter.currenttags, mytasklist.buttons)

So... uhm... to get a table that maps from integer index to client, we could do
the following (untested, s is the target screen):

local entries = {}
for _, c in ipairs(client.get(s)) do
  if awful.widget.tasklist.filter.currenttags(c, s) then
    table.insert(entries, c)
  end
end

If you really, really want to get the index from some client, you could then use
awful.util.table.hasitem(entries, c) (despite the name, it will return the table
key (or nil) and thus will get you the number you want in this case).

Cheers,
Uli
-- 
Bruce Schneier can read and understand Perl programs.

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

Reply via email to