- local vertical = args.vertical or false
- alsabar.channel = args.channel or alsabar.channel
- alsabar.step = args.step or alsabar.step
- alsabar.colors = args.colors or alsabar.colors
- alsabar.notifications = args.notifications or alsabar.notifications
-
- alsabar.bar = awful.widget.progressbar()
- alsabar.bar:set_background_color(alsabar.colors.background)
- alsabar.bar:set_color(alsabar.colors.unmute)
+ local vertical = args.vertical or false
+
+ alsabar.cmd = args.cmd or "amixer"
+ alsabar.channel = args.channel or "Master"
+ alsabar.togglechannel = args.togglechannel
+ alsabar.colors = args.colors or alsabar.colors
+ alsabar.followtag = args.followtag or false
+ alsabar.notification_preset = args.notification_preset
+
+ if not alsabar.notification_preset then
+ alsabar.notification_preset = {}
+ alsabar.notification_preset.font = "Monospace 10"
+ end
+
+ local format_cmd = string.format("%s get %s", alsabar.cmd, alsabar.channel)
+
+ if alsabar.togglechannel then
+ format_cmd = { awful.util.shell, "-c", string.format("%s get %s; %s get %s",
+ alsabar.cmd, alsabar.channel, alsabar.cmd, alsabar.togglechannel) }
+ end
+
+ alsabar.bar = wibox.widget {
+ forced_height = height,
+ forced_width = width,
+ color = alsabar.colors.unmute,
+ background_color = alsabar.colors.background,
+ margins = 1,
+ paddings = 1,
+ ticks = ticks,
+ ticks_size = ticks_size,
+ widget = wibox.widget.progressbar,
+ layout = vertical and wibox.container.rotate
+ }
+