diff options
author | crondog <patches@crondog.com> | 2015-07-24 15:08:18 +0200 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2015-07-24 15:08:18 +0200 |
commit | 211a2bfcf541b7821bd06fc97ba6e3c9ee8b6d94 (patch) | |
tree | ce50ac521b6f6488b62583c9b203291b4c7e6186 | |
parent | 56b353e773e513f98e927bad4e8062e533e10096 (diff) | |
download | vicious-legacy-master.tar.xz |
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.lua | 5 |
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 |