Microphone state widget/watcher

This widget can be used to display the current microphone status.

Requirements

Usage

local widgets = {
    mic = require("widgets/mic"),
}
theme.mic = widgets.mic({
    timeout = 10,
    settings = function(self)
        if self.state == "muted" then
            self.widget:set_image(theme.widget_micMuted)
        else
            self.widget:set_image(theme.widget_micUnmuted)
        end
    end
})
local widget_mic = wibox.widget { theme.mic.widget, layout = wibox.layout.align.horizontal }
-- Toggle microphone state
awful.key({ modkey, "Shift" }, "m",
          function ()
              beautiful.mic:toggle()
          end,
          {description = "Toggle microphone (amixer)", group = "Hotkeys"}
),
-- Mute microphone on boot
beautiful.mic:mute()