aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/audio-volume-control/README
blob: f3864b724df7fcf65cbf3a6e4f023dc851754ddc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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