How can I have only icons of applications in the tasklist in awesome 3.5?

3

In awesome 3.4 there was a way to do this:

mytasklist[s] = awful.widget.tasklist(function(c)
  local task = { awful.widget.tasklist.label.currenttags(c, s) }
  return '', task[2], task[3], task[4]
end, mytasklist.buttons)

But in awesome 3.5 that doesn't work anymore, any solutions?

Thank you

milarepa

Posted 2013-08-25T06:20:39.967

Reputation: 269

Answers

2

In awesome 3.5 this doesn't work anymore since label functions (as the anonymous function in your modified line) were replaced with filter functions which work differently. From a user's point of view (i.e. by only modifying rc.lua and theme.lua) I don't see a possibility to change or remove the tasklist text. If you really want this, a solution would be to modify the tasklist file:

--- a/usr/share/awesome/lib/awful/widget/tasklist.lua
+++ b/usr/share/awesome/lib/awful/widget/tasklist_no_names.lua
@@ -61,10 +61,12 @@ local function tasklist_label(c, args)
         if c.maximized_vertical then name = name .. maximized_vertical end
     end

-    if c.minimized then
-        name = name .. (util.escape(c.icon_name) or util.escape(c.name) or util.escape("<untitled>"))
-    else
-        name = name .. (util.escape(c.name) or util.escape("<untitled>"))
-    end
+    if theme.tasklist_show_names then
+        if c.minimized then
+            name = name .. (util.escape(c.icon_name) or util.escape(c.name) or util.escape("<untitled>"))
+        else
+            name = name .. (util.escape(c.name) or util.escape("<untitled>"))
+        end
+    end
     if capi.client.focus == c then
         bg = bg_focus

and adding an option to toggle this in your theme file:

+++ theme.lua
+ theme.tasklist_show_names = false

J0hn D0e

Posted 2013-08-25T06:20:39.967

Reputation: 36

4

To keep the icons and remove the text in the tasklist of awesome 3.5 you could write a custom function that you can give as argument to awful.widget.tasklist in your rc.lua file. This way you don't have to change anything in the awesome 'source' files

Define the following function somewhere on top of your rc.lua file or include it

function myupdate(w, buttons, label, data, objects)
    w:reset()
    local l = wibox.layout.fixed.horizontal()
    for i, o in ipairs(objects) do
        local cache = data[o]
        if cache then
            ib = cache.ib
        else
            ib = wibox.widget.imagebox()
            ib:buttons(common.create_buttons(buttons, o))

            data[o] = {
                ib = ib
            }
        end

        local text, bg, bg_image, icon = label(o)
        ib:set_image(icon)
    l:add(ib)
        --w:add(ib)
   end
   w:add(l)
end

and then add it to your awful.widget.tasklist as argument

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

ddvlamin

Posted 2013-08-25T06:20:39.967

Reputation: 41

1This solution is better because it just modifies the rc.lua. But in order to work the user must add " local common = require("awful.widget.common") " – cedlemo – 2014-12-08T18:49:10.370