You are not logged in.

#1 2012-05-09 10:11:03

mt22
Member
Registered: 2012-03-31
Posts: 20

Awesome WM Taskbar

Is there a way to show only the title of the current focused window in the taskbar??
And possibly editing only the rc.lua or theme.lua...?

If it can be useful (I thought there can be some correlation) I've already succesfully removed icons as suggested in this wiki.
http://awesome.naquadah.org/wiki/Remove_icons

Thanks.

Offline

#2 2012-05-10 18:33:06

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: Awesome WM Taskbar

I really don't know anything about Lua itself, but you might look into the widget file at /usr/share/awesome/lib/awful/widget/tasklist.lua.  You can also copy this file to ~/.config/awesome, if you don't want to risk borking your setup.

Last edited by ANOKNUSA (2012-05-10 18:33:49)

Offline

#3 2012-05-10 18:49:09

Wey
Member
Registered: 2011-04-22
Posts: 217

Re: Awesome WM Taskbar

It should be sufficient to pass the appropriate filter in the constructor. In awesome-git I am using:

mytasklist = awful.widget.tasklist(1, awful.widget.tasklist.filter.focused,{}, {});

Whereas the stock config uses awful.widget.tasklist.filter.currenttags. The syntax of the stable release varies slightly, but the idea should be transferable (See http://awesome.naquadah.org/doc/api/mod … klist.html for more details)

Offline

#4 2012-05-10 20:19:34

mt22
Member
Registered: 2012-03-31
Posts: 20

Re: Awesome WM Taskbar

Thanks for hints guys!

I substituted "currenttags" with "focused" in my rc.lua.

mytasklist[s] = awful.widget.tasklist(function(c) return awful.widget.tasklist.label.currenttags(c, s) end, mytasklist.buttons)
mytasklist[s] = awful.widget.tasklist(function(c) return awful.widget.tasklist.label.focused(c, s) end, mytasklist.buttons)

I don't know much Lua but it looks like it works.

I hope it can help someone else.


Wey: I've a dubt, is what I've done correct? Does your solution with the filter work better?

Offline

#5 2012-05-11 14:21:09

Wey
Member
Registered: 2011-04-22
Posts: 217

Re: Awesome WM Taskbar

Your code is correct for the latest release of awesome. However, in the development version of awesome, some changes where made to the way the tasklist is assembled, so in future releases you might need to adjust your config.
For details, you can compare your local /usr/share/awesome/lib/awful/widget/tasklist.lua, as anoknusa pointed out, with the git one (http://git.naquadah.org/?p=awesome.git; … in;hb=HEAD)

As a more specific example, in the stable release the tasklist widget is initialized by

function new(label, buttons)

Whereas in the git one it is

function new(screen, filter, buttons, style)

As you can see, the current constructor takes a label function (a function wrapping e. g. label.focused) and a button table. The label function is then passed to tasklist_update and will return, for each client matching the specific filter, a label created by widget_tasklist_label_common, which provides text, color and icon.

On the other hand, the development version takes a screen index, a filter function, a button table and optional style overrides. Contrary to the stable version, the filter functions will only return true or false to indicate whether a specific client should be displayed. So in tasklist_update, the filter function is simply applied to all clients to assemble the tasklist, to then create their labels using tasklist_label.

Offline

#6 2012-05-11 15:41:27

mt22
Member
Registered: 2012-03-31
Posts: 20

Re: Awesome WM Taskbar

Thanks for the clarification.

Offline

Board footer

Powered by FluxBB