Jens, please "reply all" when you are answering to the mailing-list or add [email protected] to addresses.
I could not remember where I got some parts of the code I sent you. Then I realized it is from wiki http://awesome.naquadah.org/wiki/Volume_control_and_display Example in the wiki is better if you want to put your widget on "wibox", since it periodically checks volume in case of volume has changed by any other means. So if it does not work for you, my function may also fail, post the errors you got. 2012/3/17 Can Altıparmak <[email protected]>: > You can use something like this. > > local vol_id=nil -- replace_id for volume notification > function volume(op) > local fd = io.popen("amixer sset Master " .. op) > local out = fd:read("*all") > fd:close() > > local vol = string.match(out, "(%d+)%%") > local status = string.match(out, "%[(o[^%]]*)%]") > > if not string.find(status, "on", 1, true) then > vol = vol .. "\nMuted" > end > vol_id = naughty.notify({ title = "Volume", text = vol, > timeout = 10, replaces_id = vol_id }).id > end > > Then instead of: > > awful.key({ }, "XF86AudioRaiseVolume", function () > awful.util.spawn("amixer set Master 9%+") end), > awful.key({ }, "XF86AudioLowerVolume", function () > awful.util.spawn("amixer set Master 9%-") end), > awful.key({ }, "XF86AudioMute", function () > awful.util.spawn("amixer sset Master toggle") end) > > use: > > awful.key({ }, "XF86AudioRaiseVolume", function () > volume("9%+") end), > awful.key({ }, "XF86AudioLowerVolume", function () > volume("9%-") end), > awful.key({ }, "XF86AudioMute", function () > volume("toggle") end) > > > 2012/3/17 Jens Tobiska <[email protected]>: >> Thank you. I disabled it with second parameter "false". >> >> Now I just need a way to display the volume level somehow. All widget >> examples I found so far, didn't work for me, but made awesome crash. >> >> >> 2012/3/17 Can Altıparmak <[email protected]> >>> >>> It is startup notification. >>> http://awesome.naquadah.org/wiki/Disable_startup-notification_globally >>> >>> If you don't want to disable globally. >>> http://awesome.naquadah.org/doc/api/modules/awful.util.html#spawn >>> you can call "awful.util.spawn" with second parameter "false". >>> >>> On 17 March 2012 13:42, Jens Tobiska <[email protected]> wrote: >>> > In order to make my raise/lower/mute sound buttons work, I added >>> > >>> > awful.key({ }, "XF86AudioRaiseVolume", function () >>> > awful.util.spawn("amixer set Master 9%+") end), >>> > awful.key({ }, "XF86AudioLowerVolume", function () >>> > awful.util.spawn("amixer set Master 9%-") end), >>> > awful.key({ }, "XF86AudioMute", function () >>> > awful.util.spawn("amixer sset Master toggle") end) >>> > >>> > to rc.lua. >>> > >>> > Buttons work perfectly now, i.e. they change the volume. However >>> > whenever I >>> > press one of those buttons, my mouse pointer turns into a watch for >>> > about 20 >>> > seconds. Is this a feature, or could I fix it somehow? >>> >>> >>> >>> -- >>> Can Altıparmak >> >> > > > > -- > Can Altıparmak -- Can Altıparmak -- To unsubscribe, send mail to [email protected].
