aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrondog <patches@crondog.com>2015-07-24 15:08:18 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2015-07-24 15:08:18 +0200
commit211a2bfcf541b7821bd06fc97ba6e3c9ee8b6d94 (patch)
treece50ac521b6f6488b62583c9b203291b4c7e6186
parent56b353e773e513f98e927bad4e8062e533e10096 (diff)
downloadvicious-legacy-master.tar.xz
contrib: make pulse compatible with lua5.3HEADmaster
String.format does like converting float to hex (or int for that matter). This fixes the issue Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
-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