`shell-command` prints "Shell command succeeded with no output" to
mini-buffer only to be replaced with "Volume is x%" just a bit later.
It flickers when the command is called multiple times in short time,
i.e. the user presses and holds the "vol up" button.
---
 emms-volume-pulse.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/emms-volume-pulse.el b/emms-volume-pulse.el
index 604077f..cc8530e 100644
--- a/emms-volume-pulse.el
+++ b/emms-volume-pulse.el
@@ -116,11 +116,11 @@ See full list of devices on your system by running
                             (error "pactl is not in PATH")))
                  (next-vol (emms-volume-pulse-limit
                            (+ (emms-volume--pulse-get-volume) amount))))
-             (when (zerop (shell-command
-                           (format "%s set-sink-volume %s %s%%"
-                                   pactl
-                                   (or emms-volume-pulse-sink "@DEFAULT_SINK@")
-                                   next-vol)))
+             (when (zerop (call-process
+                           pactl nil nil nil
+                           "set-sink-volume"
+                           (or emms-volume-pulse-sink "@DEFAULT_SINK@")
+                           (format "%d%%" next-vol)))
                next-vol))))
 
 (provide 'emms-volume-pulse)
-- 
2.51.0


Reply via email to