From bead40c7d0d8782f84749e610d2422b802101782 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 25 Apr 2015 15:09:25 +0200 Subject: add example audio-volume-control MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- doc/examples/audio-volume-control/README | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 doc/examples/audio-volume-control/README (limited to 'doc/examples/audio-volume-control/README') diff --git a/doc/examples/audio-volume-control/README b/doc/examples/audio-volume-control/README new file mode 100644 index 0000000..f3864b7 --- /dev/null +++ b/doc/examples/audio-volume-control/README @@ -0,0 +1,33 @@ +Use-case example. + +Assume you have program that display the audio volume. +This program checks every second third if the volume +have changed. + +Also assume that you use amixer to change the volume, +most often by using keybindings via xbindkeys. + +To reduce the delay, you want to send a signal to the +monitor program that the volume have changed. For this +more primitive IPC is sufficient, but lets assume there +are other programs interested in this information too. + +To accomplish this, you create a wrapper for amixer +than broadcasts updates on a bus. This wrapper is +installed as ~/.local/bin/amixer, and ~/.local/bin/ +is included in $PATH before /usr/bin. + + + +Before starting run ~/.init, this code is +should be run from your profile file if you +want to implement this on your system. + +After running ~/.init, you can start one +or more listeners by running ~/.alsa-monitor. + +To change the volume run +`./amixer -c 0 -- set Master 5%+` or similar. + +When you are done run ~/.cleanup + -- cgit v1.2.3-70-g09d2