diff --git a/contrib/README.md b/contrib/README.md index 622ba24..67f6105 100644 --- a/contrib/README.md +++ b/contrib/README.md @@ -117,24 +117,28 @@ vicious.contrib.ossvol vicious.contrib.pop - -vicious.contrib.pulse - - provides volume levels of requested pulseaudio sinks and - functions to manipulate them - - takes the name of a sink as an optional argument. a number will - be interpret as an index, if no argument is given, it will take - the first-best - - to get a list of available sinks use the command: pacmd - list-sinks | grep 'name:' - - returns 1st value as the volume level - - vicious.contrib.pulse.add(percent, sink) - - @percent is a number, which increments or decrements the volume - level by its value in percent - - @sink optional, same usage as in vicious.contrib.pulse - - returns the exit status of pacmd - - vicious.contrib.pulse.toggle(sink) - - inverts the volume state (mute -> unmute; unmute -> mute) - - @sink optional, same usage as in vicious.contrib.pulse - - returns the exit status of pacmd +**vicious.contrib.pulse** + +Provides volume levels of requested pulseaudio sinks and functions to +manipulate them + +- Arguments + * takes the name of a sink as an optional argument. a number will + be interpret as an index, if no argument is given, it will take + the first-best + * to get a list of available sinks use the command: pacmd + list-sinks | grep 'name:' +- Returns + * returns 1st value as the volume level +- vicious.contrib.pulse.add(percent, sink) + * @percent is a number, which increments or decrements the volume + level by its value in percent + * @sink optional, same usage as in vicious.contrib.pulse + * returns the exit status of pacmd +- vicious.contrib.pulse.toggle(sink) + * inverts the volume state (mute -> unmute; unmute -> mute) + * @sink optional, same usage as in vicious.contrib.pulse + * returns the exit status of pacmd vicious.contrib.rss - diff --git a/contrib/pulse.lua b/contrib/pulse_all.lua similarity index 94% rename from contrib/pulse.lua rename to contrib/pulse_all.lua index 663a6ab..5916bb1 100644 --- a/contrib/pulse.lua +++ b/contrib/pulse_all.lua @@ -26,7 +26,7 @@ local math = { -- Pulse: provides volume levels of requested pulseaudio sinks and methods to change them -- vicious.contrib.pulse -local pulse = {} +local pulse_all = {} -- {{{ Helper function local function pacmd(args) @@ -87,7 +87,7 @@ end -- }}} -- {{{ Volume control helper -function pulse.add(percent, sink) +function pulse_all.add(percent, sink) sink = get_sink_name(sink) if sink == nil then return end @@ -106,7 +106,7 @@ function pulse.add(percent, sink) return os.execute(cmd) end -function pulse.toggle(sink) +function pulse_all.toggle(sink) sink = get_sink_name(sink) if sink == nil then return end @@ -121,4 +121,4 @@ function pulse.toggle(sink) end -- }}} -return setmetatable(pulse, { __call = function(_, ...) return worker(...) end }) +return setmetatable(pulse_all, { __call = function(_, ...) return worker(...) end })