- local args = args or {}
- local timeout = args.timeout or 5
- local settings = args.settings or function() end
- local width = args.width or 63
- local height = args.heigth or 1
- local ticks = args.ticks or false
- local ticks_size = args.ticks_size or 7
- local vertical = args.vertical or false
-
- alsabar.cmd = args.cmd or "amixer"
- 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.followtag = args.followtag or false
+ local args = args or {}
+ local timeout = args.timeout or 5
+ local settings = args.settings or function() end
+ local width = args.width or 63
+ local height = args.height or 1
+ local ticks = args.ticks or false
+ local ticks_size = args.ticks_size or 7
+ 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 = naughty.config.defaults
+ alsabar.notification_preset.font = "Monospace 11"
+ 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