From bd08badccca65ddff979f759b161d34211b4a8a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 25 Jan 2017 20:10:04 +0100 Subject: [PATCH] move pulse widget to new layout --- contrib/README.md | 40 +++++++++++++++------------- contrib/{pulse.lua => pulse_all.lua} | 8 +++--- 2 files changed, 26 insertions(+), 22 deletions(-) rename contrib/{pulse.lua => pulse_all.lua} (94%) 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 })