about summary refs log tree commit diff
path: root/configs/shared/.emacs.d/wpc/pulse-audio.el
diff options
context:
space:
mode:
Diffstat (limited to 'configs/shared/.emacs.d/wpc/pulse-audio.el')
-rw-r--r--configs/shared/.emacs.d/wpc/pulse-audio.el43
1 files changed, 15 insertions, 28 deletions
diff --git a/configs/shared/.emacs.d/wpc/pulse-audio.el b/configs/shared/.emacs.d/wpc/pulse-audio.el
index 87e0c7c5ed30..b81f88c1b098 100644
--- a/configs/shared/.emacs.d/wpc/pulse-audio.el
+++ b/configs/shared/.emacs.d/wpc/pulse-audio.el
@@ -10,6 +10,7 @@
 ;; Dependencies
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+(require 'prelude)
 (require 'string)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -33,49 +34,35 @@
 (defun pulse-audio/toggle-mute ()
   "Mute the default sink."
   (interactive)
-  (start-process
-   "*pactl<pulse-audio/toggle-mute>*"
-   nil
-   "pactl"
-   "set-sink-mute"
-   "@DEFAULT_SINK@"
-   "toggle")
+  (prelude/start-process
+   :name "pulse-audio/toggle-mute"
+   :command "pactl set-sink-mute @DEFAULT_SINK@ toggle")
   (pulse-audio/message "Mute toggled."))
 
 (defun pulse-audio/toggle-microphone ()
   "Mute the default sink."
   (interactive)
-  (start-process
-   "*pactl<pulse-audio/toggle-mute>*"
-   nil
-   "pactl"
-   "set-source-mute"
-   "@DEFAULT_SOURCE@"
-   "toggle")
+  (prelude/start-process
+   :name "pulse-audio/toggle-microphone"
+   :command "pactl set-source-mute @DEFAULT_SOURCE@ toggle")
   (pulse-audio/message "Microphone toggled."))
 
 (defun pulse-audio/decrease-volume ()
   "Low the volume output of the default sink."
   (interactive)
-  (start-process
-   "*pactl<pulse-audio/toggle-mute>*"
-   nil
-   "pactl"
-   "set-sink-volume"
-   "@DEFAULT_SINK@"
-   (string/format "-%s%%" pulse-audio/step-size))
+  (prelude/start-process
+   :name "pulse-audio/decrease-volume"
+   :command (string/format "pactl set-sink-volume @DEFAULT_SINK@ -%s%%"
+                           pulse-audio/step-size))
   (pulse-audio/message "Volume decreased."))
 
 (defun pulse-audio/increase-volume ()
   "Raise the volume output of the default sink."
   (interactive)
-  (start-process
-   "*pactl<pulse-audio/toggle-mute>*"
-   nil
-   "pactl"
-   "set-sink-volume"
-   "@DEFAULT_SINK@"
-   (string/format "+%s%%" pulse-audio/step-size))
+  (prelude/start-process
+   :name "pulse-audio/increase-volume"
+   :command (string/format "pactl set-sink-volume @DEFAULT_SINK@ +%s%%"
+                           pulse-audio/step-size))
   (pulse-audio/message "Volume increased."))
 
 (when pulse-audio/install-kbds?