You are not logged in.

#1 2012-07-12 18:36:31

thomas78
Member
Registered: 2011-08-23
Posts: 6

Vicious progressbar widget problem.

I make two progressbar widgets in my rc.lua. Both get placed between the taglist and tasklist. My normal text widgets gets places as intended (to the left of my layoutbox). Nothing i do in r.lua can change where the progressbars are placed. I want them along the other widgets. I attach the relevant rc.lua parts under. Any ideas why just the bars are stubborn?

--  Wibox
-- Create a textbox widget
mytextclock = awful.widget.textclock({align = "right"})

-- wifi
wifiwidget = widget({ type = "textbox" })
vicious.register(wifiwidget, vicious.widgets.wifi,  "\"${ssid}\" ${link}% ${rate} MB/s", 10, "wlan0")

-- Battery widget
batwidget = awful.widget.progressbar()
batwidget:set_width(15)
batwidget:set_height(25)
batwidget:set_vertical(true)
batwidget:set_background_color("#494B4F")
batwidget:set_border_color(nil)
batwidget:set_color("#AECF96")
batwidget:set_gradient_colors({ "#AECF96", "#88A175", "#FF5656" })
vicious.register(batwidget, vicious.widgets.bat, "$2", 61, "BAT0")

-- Battery 2 widget
batwidget2 = widget({ type = "textbox" })
vicious.register(batwidget2, vicious.widgets.bat, "battery:$2", 61, "BAT0")

-- Memory usage (progressbar
memwidget = awful.widget.progressbar()
-- Progressbar properties
memwidget:set_width(8)
memwidget:set_height(10)
memwidget:set_vertical(true)
memwidget:set_background_color("#494B4F")
memwidget:set_border_color(nil)
memwidget:set_color("#AECF96")
memwidget:set_gradient_colors({ "#AECF96", "#88A175", "#FF5656" })
-- Register widget
vicious.register(memwidget, vicious.widgets.mem, "$1", 13)

-- seperator
seperator = widget({ type = "textbox" })
seperator.text = " || "

-- Create a launcher widget and a main menu
myawesomemenu = {
    {"manual", terminal .. " -e man awesome"},
    {"edit config",
     editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua"},
    {"restart", awesome.restart},
    {"quit", awesome.quit}
}

mymainmenu = awful.menu(
    {
        items = {
            {"awesome", myawesomemenu, beautiful.awesome_icon},
              {"open terminal", terminal},
	      {"Power off", poweroff}}
          })

mylauncher = awful.widget.launcher({image = image(beautiful.awesome_icon),
                                     menu = mymainmenu})

-- Create a systray
mysystray = widget({type = "systray", align = "right"})

-- Create a wibox for each screen and add it
mywibox = {}
mypromptbox = {}
mylayoutbox = {}
mytaglist = {}
mytaglist.buttons = awful.util.table.join(
    awful.button({}, 1, awful.tag.viewonly),
    awful.button({modkey}, 1, awful.client.movetotag),
    awful.button({}, 3, function(tag) tag.selected = not tag.selected end),
    awful.button({modkey}, 3, awful.client.toggletag),
    awful.button({}, 4, awful.tag.viewnext),
    awful.button({}, 5, awful.tag.viewprev)
    )

mytasklist = {}
mytasklist.buttons = awful.util.table.join(
    awful.button({}, 1, function(c)
        if not c:isvisible() then
            awful.tag.viewonly(c:tags()[1])
        end
        client.focus = c
        c:raise()
        end),
    awful.button({}, 3, function()
        if instance then
            instance:hide()
            instance = nil
        else
            instance = awful.menu.clients({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))

for s = 1, screen.count() do
    -- Create a promptbox for each screen
    mypromptbox[s] =
        awful.widget.prompt({layout = awful.widget.layout.leftright})
    -- Create an imagebox widget which will contains an icon indicating which
    -- layout we're using.  We need one layoutbox per screen.
    mylayoutbox[s] = awful.widget.layoutbox(s)
    mylayoutbox[s]:buttons(awful.util.table.join(
            awful.button({}, 1, function() awful.layout.inc(layouts, 1) end),
            awful.button({}, 3, function() awful.layout.inc(layouts, -1) end),
            awful.button({}, 4, function() awful.layout.inc(layouts, 1) end),
            awful.button({}, 5, function() awful.layout.inc(layouts, -1) end)))
    -- Create a taglist widget
    mytaglist[s] = awful.widget.taglist.new(s,
                                            awful.widget.taglist.label.all,
                                            mytaglist.buttons)

    -- Create a tasklist widget
    mytasklist[s] = awful.widget.tasklist.new(function(c)
                        return awful.widget.tasklist.label.currenttags(c, s)
                    end,
                                              mytasklist.buttons)

    -- Create the wibox
    mywibox[s] = awful.wibox({position = "top", height = "25", screen = s})
    -- Add widgets to the wibox - order matters
    mywibox[s].widgets = {
        {
            mylauncher,
            mytaglist[s],
            mypromptbox[s],
            layout = awful.widget.layout.horizontal.leftright
        },
        mylayoutbox[s],
	seperator,
        mytextclock,
	seperator,
	batwidget,
	seperator,
	wifiwidget,
	seperator,
	memwidget,
	seperator,
	batwidget2,
	seperator,
        s == 1 and mysystray or nil,
        mytasklist[s],
        layout = awful.widget.layout.horizontal.rightleft
    } 
    mywibox[s].screen = s
end

Offline

#2 2012-07-13 00:59:18

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Vicious progressbar widget problem.


You need to install an RTFM interface.

Offline

#3 2012-07-13 01:56:00

thomas78
Member
Registered: 2011-08-23
Posts: 6

Re: Vicious progressbar widget problem.

Thanks for replying, but my rc.lua still dont work. I must be blind.

Last edited by thomas78 (2012-07-13 02:04:36)

Offline

#4 2012-07-15 21:06:45

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Vicious progressbar widget problem.

Then read it again.


You need to install an RTFM interface.

Offline

#5 2012-07-17 06:33:00

thomas78
Member
Registered: 2011-08-23
Posts: 6

Re: Vicious progressbar widget problem.

Alright, so apperently you need to reference the ".widget" for it to work. Pretty confusing that it showed up at all without it.

Last edited by thomas78 (2012-07-17 06:34:46)

Offline

#6 2012-07-20 02:49:57

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Vicious progressbar widget problem.

Yes. I didn't look at that code in a while but I think what happens is that the actual widget object is returned by default however the layout of the wibox.widgets does not apply to it so it remains using its default internal layout which is leftright.


You need to install an RTFM interface.

Offline

Board footer

Powered by FluxBB