thanks for your quick reply Abhijeet, and thanks David Gomes. I have google that page. haha, And I have seen someone has successful changed that icon. but I don't know how..

this is my volume applet config

-- Volume widget

volumecfg = {}
volumecfg.cardid  = 0
volumecfg.channel = "Master"
volumecfg.widget = widget({ type = "textbox", name = "volumecfg.widget", align = "right" })

volumecfg_t = awful.tooltip({ objects = { volumecfg.widget },})
volumecfg_t:set_text("Volume")

-- command must start with a space!
volumecfg.mixercommand = function (command)
      local fd = io.popen("amixer -c " .. volumecfg.cardid .. command)
      local status = fd:read("*all")
      fd:close()

      local volume = string.match(status, "(%d?%d?%d)%%")
volume = string.format("<span color='#1793d1'>%3d</span>", volume)
      status = string.match(status, "%[(o[^%]]*)%]")
      if string.find(status, "on", 1, true) then
              volume = volume .. "<span color='#1793d1'>%</span>"
      else
              volume = volume .. "<span color='#ff5656'>M</span>"
      end
      volumecfg.widget.text = volume
end
volumecfg.update = function ()
      volumecfg.mixercommand(" sget " .. volumecfg.channel)
end
volumecfg.up = function ()
      volumecfg.mixercommand(" sset " .. volumecfg.channel .. " 2%+")
end
volumecfg.down = function ()
      volumecfg.mixercommand(" sset " .. volumecfg.channel .. " 2%-")
end
volumecfg.toggle = function ()
volumecfg.mixercommand(" sset " .. volumecfg.channel .. " toggle")
end
volumecfg.widget:buttons({
      button({ }, 4, function () volumecfg.up() end),
      button({ }, 5, function () volumecfg.down() end),
      button({ }, 1, function () volumecfg.toggle() end)
})
volumecfg.update()

-----------EOF

the problem is , when I click the widget and it execute volumecfg.toggle() , the computer gets mute, and I can't get it unmute unless I use the gnome-sound-applet or something like that.. what do you think about that problem?

pylemon


于Tue 17 Jul 2012 05:36:36 PM CST,Abhijeet R写到:
Well, I actually don't have a solution but you can use vicious to
create a widget like this.

-- {{{ Volume level
volicon = widget({ type = "imagebox" })
volicon.image = image(awful.util.getdir("config") .. "/icons/vol.png")

volwidget = widget({ type = "textbox" })
vicious.cache(vicious.widgets.volume)
-- Register widgets
vicious.register(volwidget, vicious.widgets.volume, " $1%", 2, "Master")
-- Register buttons
volwidget:buttons(awful.util.table.join(
  awful.button({ }, 1, function () exec("gnome-alsamixer") end),
  awful.button({ }, 4, function () exec("amixer -q set Master 2dB+",
false) vicious.force({volwidget}) end),
  awful.button({ }, 5, function () exec("amixer -q set Master 2dB-",
false) vicious.force({volwidget}) end)
))

In the above configuration, scrolling on the textwidget changes the
sound too. Also, clicking on it opens gnome-alsamixer.

On Tue 17 Jul 2012 02:52:42 PM IST, David Gomes wrote:
I've had the same problem:
http://askubuntu.com/questions/105614/change-gnome-sound-applet-icon

I couldn't really get an answer, not sure if it's possible. I just
ended up using a textbox to display my sound, but I'd love to find a
way around this too.

On Tue, Jul 17, 2012 at 8:37 AM, pyLemon <leeway1...@gmail.com
<mailto:leeway1...@gmail.com>> wrote:

    hi:

    I use the gnome-sound-applet to control sound in my awesome
    settings, and it has a full black icon. However, my top panel is
    also black, so I can't see the icon.

    Is it possible to change the icon? Thanks!


    best regards,
    pylemon

    --
    To unsubscribe, send mail to awesome-unsubscribe@naquadah.__org
    <mailto:awesome-unsubscr...@naquadah.org>.






--
To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.

Reply via email to