aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/pulse.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/pulse.lua b/contrib/pulse.lua
index b06bf56..663a6ab 100644
--- a/contrib/pulse.lua
+++ b/contrib/pulse.lua
@@ -18,7 +18,8 @@ local string = {
gmatch = string.gmatch
}
local math = {
- floor = math.floor
+ floor = math.floor,
+ ceil = math.ceil
}
-- }}}
@@ -99,6 +100,8 @@ function pulse.add(percent, sink)
if vol > 0x10000 then vol = 0x10000 end
if vol < 0 then vol = 0 end
+ vol = math.ceil(vol)
+
local cmd = string.format("pacmd set-sink-volume %s 0x%x >/dev/null", sink, vol)
return os.execute(cmd)
end