You are not logged in.

#1 2013-01-03 10:41:03

Steffo
Member
Registered: 2012-10-27
Posts: 34

[SOLVED] awesome 3.5.2: Volume Widget doesn't work anymore

Hi folks,
this volume widget doesn't work anymore after upgrading awesome:
http://awesome.naquadah.org/wiki/Volume … nd_display

I get the error

volume.lua:1: attempts to call global 'widget' (a nil value)

This is the file:

volume_widget = widget({ type = "textbox", name = "tb_volume", align = "right" })

    function update_volume(widget)
        local fd = io.popen("amixer sget Master")
        local status = fd:read("*all")
        fd:close()
        
        local volume = tonumber(string.match(status, "(%d?%d?%d)%%")) / 100
        -- volume = string.format("% 3d", volume)

        status = string.match(status, "%[(o[^%]]*)%]")

        -- starting colour
        local sr, sg, sb = 0x3F, 0x3F, 0x3F
        -- ending colour
        local er, eg, eb = 0xDC, 0xDC, 0xCC

        local ir = volume * (er - sr) + sr
        local ig = volume * (eg - sg) + sg
        local ib = volume * (eb - sb) + sb
        interpol_colour = string.format("%.2x%.2x%.2x", ir, ig, ib)
        if string.find(status, "on", 1, true) then
            volume = " <span background='#" .. interpol_colour .. "'>   </span>"
        else
            volume = " <span color='red' background='#" .. interpol_colour .. "'> M </span>"
        end
        widget.text = volume
     end

    update_volume(volume_widget)
    awful.hooks.timer.register(1, function () update_volume(volume_widget) end)

Any ideas?

Thanks in advance!

Steffo

Last edited by Steffo (2013-01-04 11:25:39)

Offline

#2 2013-01-03 11:16:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,554
Website

Re: [SOLVED] awesome 3.5.2: Volume Widget doesn't work anymore

While I don't use awesome, there have been a very large number of awesomewm problem threads recently.  It seems a majority of them came from users updating awesome without replacing or merging the new configs.  As the configuration has changed notably in the last update this has caused all sorts of problems.

Do you have the same problem if you move/rename all your current configs and replace them with the stock/default ones that were just installed with the update?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2013-01-03 12:20:26

Steffo
Member
Registered: 2012-10-27
Posts: 34

Re: [SOLVED] awesome 3.5.2: Volume Widget doesn't work anymore

Well the problem is, that my config in my home directory don't get loaded because of the error I described here and then the default config in /etc gets loaded what is not what I want, because essential features like increasing/decreasing volume is not supported by default...

Best regards
Stefano

Offline

#4 2013-01-03 15:24:28

exezive
Member
Registered: 2013-01-03
Posts: 1

Re: [SOLVED] awesome 3.5.2: Volume Widget doesn't work anymore

The api for widget changed in the 3.5 update according to their update documentation.
http://awesome.naquadah.org/wiki/Awesom … eplacement

Offline

#5 2013-01-04 10:40:17

Steffo
Member
Registered: 2012-10-27
Posts: 34

Re: [SOLVED] awesome 3.5.2: Volume Widget doesn't work anymore

OK, I ported the volume widget by myself with some help from the awesome wm mailing list.
I updated the wiki:

https://awesome.naquadah.org/wiki/Volum … nd_display

Offline

Board footer

Powered by FluxBB