You are not logged in.

#1 2014-10-23 17:40:42

Neldar
Member
Registered: 2014-10-23
Posts: 11

Awesome taskbar

Hello,

I'm using Awesome WM and I try to make my task bar look like this:
http://i1219.photobucket.com/albums/dd4 … -dirty.png

So when an application is launched, I only want the icon to be at the left of the taskbar. Does someone know how to perform this?
I tried with looking the function of awful and beautiful, trying to change this code in rc.lua

mytasklist = {}
mytasklist.buttons = awful.util.table.join(
                     awful.button({ }, 1, function (c)
                                              if c == client.focus then
                                                  c.minimized = true
                                              else
                                                  -- Without this, the following
                                                  -- :isvisible() makes no sense
                                                  c.minimized = false
                                                  if not c:isvisible() then
                                                      awful.tag.viewonly(c:tags()[1])
                                                  end
                                                  -- This will also un-minimize
                                                  -- the client, if needed
                                                  client.focus = c
                                                  c:raise()
                                              end
                                          end),
                     awful.button({ }, 3, function ()
                                              if instance then
                                                  instance:hide()
                                                  instance = nil
                                              else
                                                  instance = awful.menu.clients({
                                                      theme = { width = 250 }
                                                  })
                                              end
                                          end),
                     awful.button({ }, 4, function ()
                                              awful.client.focus.byidx(1)
                                              if client.focus then client.focus:raise() end
                                          end),
                     awful.button({ }, 5, function ()
                                              awful.client.focus.byidx(-1)
                                              if client.focus then client.focus:raise() end
                                          end))

or these variables in theme.lua

tasklist_[bg|fg]_[focus|urgent] 

but nothing worked.

At this time, my taskbar look like this:
http://img15.hostingpics.net/pics/54206 … 8scrot.png

Thanks in advance smile

-- mod edit: converted images to links, please see forum guidelines on images --

Last edited by Trilby (2014-10-23 18:59:59)

Offline

#2 2014-10-23 17:43:22

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,548

Re: Awesome taskbar

There is a way to use gnome and awesome together.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#3 2014-10-23 17:48:49

Neldar
Member
Registered: 2014-10-23
Posts: 11

Re: Awesome taskbar

I don't want to use gnome, I just want to customize the taskbar

Offline

#4 2014-10-28 09:39:59

Darkcloud
Member
From: Germany
Registered: 2013-08-24
Posts: 15

Re: Awesome taskbar

You should be able to achieve this by changing the tasklist creation.
According to the (unfortunately sometimes lacking) documentation (https://awesome.naquadah.org/doc/api/mo … klist.html),
you need to use a different update_function and base_widget.

Copy the code from the common.list_update function (/usr/share/awesome/lib/awful/widget/common.lua) to your own update function.
Change it so that it only displays the icon:

local widget_common = require("awful.widget.common")

function my_list_update(w, buttons, label, data, objects)
    -- update the widgets, creating them if needed
    w:reset()
    for i, o in ipairs(objects) do
        local cache = data[o]
        local ib, tb, bgb, m, l
        if cache then
            ib = cache.ib
            tb = cache.tb
            bgb = cache.bgb
            m   = cache.m
        else
            ib = wibox.widget.imagebox()
            tb = wibox.widget.textbox()
            bgb = wibox.widget.background()
            m = wibox.layout.margin(tb, 4, 4)
            l = wibox.layout.fixed.horizontal()

            -- All of this is added in a fixed widget
            l:fill_space(true)
            l:add(ib)
            l:add(m)

            -- And all of this gets a background
            bgb:set_widget(l)

            bgb:buttons(widget_common.create_buttons(buttons, o))

            data[o] = {
                ib = ib,
                tb = tb,
                bgb = bgb,
                m   = m
            }
        end

        local text, bg, bg_image, icon = label(o)
        bgb:set_bg(bg)
        if type(bg_image) == "function" then
            bg_image = bg_image(tb,o,m,objects,i)
        end
        bgb:set_bgimage(bg_image)
        ib:set_image(icon)
        w:add(bgb)
   end
end

Create/change your tasklist (this goes into the for s = 1, screen.count() do - section):

mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons, nil, my_list_update, wibox.layout.fixed.horizontal())

Since you want the icons right beside the taglist, add it to the left layout:

left_layout:add(mytasklist[s])

and remove/comment out the

layout:set_middle(mytasklist[s])

part.

Offline

Board footer

Powered by FluxBB